Ahmed Eka Posted September 23, 2016 Posted September 23, 2016 Hello .. I want a help how can I create a marker after 5 min destroy it if any one know please give me the code .. thanks ..
Captain Cody Posted September 23, 2016 Posted September 23, 2016 createMarker setTimer destroyElement
Ahmed Eka Posted September 23, 2016 Author Posted September 23, 2016 12 hours ago, CodyL said: createMarker setTimer destroyElement okey what's wrong ? local players = {} function TimerFunc(players) players[player] = 0 if getElementData(players[player],"NukePlayer") then outputChatBox("1") players[player] = players[player] + 1 outputChatBox(players[player]) if players[player] == 10 then setElementData(player,"NukePlayer",false) if isElement(marker [ player ]) then destroyElement(marker [ player ]) if isElement(object [ player ]) then destroyElement(object [ player ]) players[player] = 0 end end end end end setTimer(TimerFunc,1000,0) ??
Captain Cody Posted September 23, 2016 Posted September 23, 2016 Player is undefined local players = {} function TimerFunc() players[player] = 0 if getElementData(players[player],"NukePlayer") then outputChatBox("1") players[player] = players[player] + 1 outputChatBox(players[player]) end if players[player] == 10 then setElementData(player,"NukePlayer",false) if isElement(marker [ player ]) then destroyElement(marker [ player ]) end if isElement(object [ player ]) then destroyElement(object [ player ]) players[player] = 0 end end setTimer(TimerFunc,1000,0)
Ahmed Eka Posted September 23, 2016 Author Posted September 23, 2016 12 hours ago, CodyL said: Player is undefined local players = {} function TimerFunc() players[player] = 0 if getElementData(players[player],"NukePlayer") then outputChatBox("1") players[player] = players[player] + 1 outputChatBox(players[player]) end if players[player] == 10 then setElementData(player,"NukePlayer",false) if isElement(marker [ player ]) then destroyElement(marker [ player ]) end if isElement(object [ player ]) then destroyElement(object [ player ]) players[player] = 0 end end setTimer(TimerFunc,1000,0) debug says the table is nil and the code isn't workin .. the marker and the object isn't hide ,,
Gravestone Posted September 24, 2016 Posted September 24, 2016 Maybe add this? for i, player in ipairs(getElementsByType("player") do if getElementData(player, "NukePlayer") then -- code here end end
!#NssoR_) Posted September 24, 2016 Posted September 24, 2016 10 hours ago, M[A]X said: debug says the table is nil and the code isn't workin .. the marker and the object isn't hide ,, it's normal that the debug would show you that error , because ' player ' undefined. and the script in client side? if yes , Nobody will see the marker you've created .
Ahmed Eka Posted September 24, 2016 Author Posted September 24, 2016 1 hour ago, NssoR said: it's normal that the debug would show you that error , because ' player ' undefined. and the script in client side? if yes , Nobody will see the marker you've created . No It's server side.
!#NssoR_) Posted September 24, 2016 Posted September 24, 2016 2 hours ago, NssoR said: it's normal that the debug would show you that error , because ' player ' undefined. and the script in client side? if yes , Nobody will see the marker you've created .
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