RandomRambo Posted August 23, 2021 Share Posted August 23, 2021 (edited) hey,I have script of bots zombie ; I need to show info about their hp after player hit them. I tryed to show it in chat: outputChatBox("blood "..tostring(getElementData ( zomb,'blood' ))) And it works fine,but I want to do it in notifications: triggerClientEvent(source, "add:notification", source, "..tostring(getElementData ( zomb,'blood' ))", "info",true) But it doesn't work (I have this resource turned on notifications ) Help please,how I can show bot's HP with these notifications Edited August 23, 2021 by RandomRambo Link to comment
βurak Posted August 24, 2021 Share Posted August 24, 2021 (edited) There is a typo in your code, change it like this You are passing getElementData to the parameter completely as a string local zombieHealth = tostring(getElementData(zomb, "blood")) triggerClientEvent(source, "add:notification", source, zombieHealth, "info", true) Edited August 24, 2021 by Burak5312 1 Link to comment
RandomRambo Posted August 24, 2021 Author Share Posted August 24, 2021 56 minutes ago, Burak5312 said: There is a typo in your code, change it like this You are passing getElementData to the parameter completely as a string local zombieHealth = tostring(getElementData(zomb, "blood")) triggerClientEvent(source, "add:notification", source, zombieHealth, "info", true) Should I just put this in fuction without deleting anything? Link to comment
βurak Posted August 24, 2021 Share Posted August 24, 2021 11 minutes ago, RandomRambo said: Should I just put this in fuction without deleting anything? yes do so Link to comment
RandomRambo Posted August 24, 2021 Author Share Posted August 24, 2021 6 minutes ago, Burak5312 said: yes do so ye,it works ,thank you so much And I just realised,is it possible that when it shows notifications (it shows just HP of bot in numbers),is it possible to show like this - "Bot hp: "here is numbers"".I mean is it possbile to show also text "bot hp:" May be like this?: triggerClientEvent(source, "add:notification", source,"bot hp:", zombieHealth, "info", true) am I right? Link to comment
βurak Posted August 24, 2021 Share Posted August 24, 2021 Just now, RandomRambo said: ye,it works ,thank you so much And I just realised,is it possible that when it shows notifications (it shows just HP of bot in numbers),is it possible to show like this - "Bot hp: "here is numbers"".I mean is it possbile to show also text "bot hp:" May be like this?: triggerClientEvent(source, "add:notification", source,"bot hp:", zombieHealth, "info", true) am I right? combine it with zombieHealth here's how triggerClientEvent(source, "add:notification", source, "bot hp: "..zombieHealth, "info", true) 1 Link to comment
RandomRambo Posted August 24, 2021 Author Share Posted August 24, 2021 5 minutes ago, Burak5312 said: combine it with zombieHealth here's how triggerClientEvent(source, "add:notification", source, "bot hp: "..zombieHealth, "info", true) Thanks a lot!Everything works perfectly! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now