Jump to content

Info about healthpoints


RandomRambo

Recommended Posts

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 by RandomRambo
Link to comment
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 by Burak5312
  • Thanks 1
Link to comment
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
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
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)

 

  • Thanks 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...