scolen Posted September 6, 2023 Posted September 6, 2023 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)
FlorinSzasz Posted September 6, 2023 Posted September 6, 2023 (edited) 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 September 6, 2023 by FlorinSzasz 1
scolen Posted September 6, 2023 Author Posted September 6, 2023 2 minutes ago, FlorinSzasz said: Well remove player argument from the function on the Event ,,onClientRender' just function() and on getElementData replace player with localPlayer thank you so much! FlorinSzasz
DiSaMe Posted September 8, 2023 Posted September 8, 2023 On 06/09/2023 at 21:27, dexter1546 said: Why tostring if you using number? It's passed to outputChatBox, which requires a string. 1
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