Jump to content

HELP| getElementData False ?


scolen

Recommended Posts

Why is outPutChatBox saying false instead of 1 ? What I need is to get the outPutChatBox as 1

marker = createMarker(2093.75464, -1948.29468, 13.54688, "cylinder", 1)
addEventHandler("onClientMarkerHit", marker, function(player)
   setElementData(player, "item", 1)
   outputChatBox("hitted")
end)

addEventHandler("onClientRender", root, function(player)
    count = tostring(getElementData(player, "item"))
    outputChatBox(count)
end)

 

Link to comment
10 minutes ago, scolen said:

Why is outPutChatBox saying false instead of 1 ? What I need is to get the outPutChatBox as 1

marker = createMarker(2093.75464, -1948.29468, 13.54688, "cylinder", 1)
addEventHandler("onClientMarkerHit", marker, function(player)
   setElementData(player, "item", 1)
   outputChatBox("hitted")
end)

addEventHandler("onClientRender", root, function(player)
    count = tostring(getElementData(player, "item"))
    outputChatBox(count)
end)

 

Well remove player argument from the function on the Event ,,onClientRender' 

just 

function()

and on getElementData  replace player with localPlayer

Also onClientRender will output something/ refresh every second if i remember, so until the data is not true then it wont output only false.

Edited by FlorinSzasz
  • 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...