Murilo_apa Posted November 26, 2022 Share Posted November 26, 2022 local cooldown = {} local tick = getTickCount() function dxConce() if exibindo_painelC == false then if cooldown[element] and tick - cooldown[element] < 5000 then return end cooldown = tick addEventHandler("onClientRender", root, drawConce) exibindo_painelC = true bindKey('backspace','down', function() if exibindo_painelC == true then removeEventHandler("onClientRender", root, drawConce) setCameraTarget (localPlayer) exibindo_painel = false end end) end end Help me please! after I enter the marker for the first time it stops working! looks like an error with the cooldown, but I can't identify it (I'm using the translator). Link to comment
mafioz Posted November 26, 2022 Share Posted November 26, 2022 (edited) local cooldown = {} local tick = getTickCount() function dxConce() if exibindo_painelC == false then if cooldown[element] and tick - cooldown[element] < 5000 then return end cooldown = tick addEventHandler("onClientRender", root, drawConce) exibindo_painelC = true bindKey('backspace','down', function() if exibindo_painelC == true then removeEventHandler("onClientRender", root, drawConce) setCameraTarget (localPlayer) exibindo_painelC = false end end) end end Edited November 26, 2022 by shishani Link to comment
Murilo_apa Posted November 26, 2022 Author Share Posted November 26, 2022 (edited) Didn't work... ERROR: attempt to index upvalue 'cooldown' (a number value) Edited November 26, 2022 by Murilo_apa Link to comment
mafioz Posted November 26, 2022 Share Posted November 26, 2022 (edited) local cooldown = {} local tick = getTickCount() function dxConce() if exibindo_painelC == false then if cooldown[element] and tick - cooldown[element] < 5000 then return end cooldown[element] = tick addEventHandler("onClientRender", root, drawConce) exibindo_painelC = true bindKey('backspace','down', function() if exibindo_painelC == true then removeEventHandler("onClientRender", root, drawConce) setCameraTarget (localPlayer) exibindo_painelC = false end end) end end Edited November 26, 2022 by shishani Link to comment
Murilo_apa Posted November 26, 2022 Author Share Posted November 26, 2022 an error appears... ERROR: table index is null Link to comment
mafioz Posted November 26, 2022 Share Posted November 26, 2022 (edited) 7 minutes ago, Murilo_apa said: an error appears... ERROR: table index is null Line? Very little information. where did the variable "element" come from? Edited November 26, 2022 by shishani Link to comment
Murilo_apa Posted November 26, 2022 Author Share Posted November 26, 2022 (edited) Estou com dificuldades para fazer um script de atendido , quando o player está no marcador os dx ao lado do setCameraMatrix são chamados, e quando o backspace é engolido, na teoria era para retirar o EventHandler e voltar tudo ao normal. O cooldown seria evitar um loop, the script is of type client and the player comes from client side script. Edited November 26, 2022 by Murilo_apa Link to comment
mafioz Posted November 26, 2022 Share Posted November 26, 2022 (edited) You did not answer my question 19 minutes ago, Murilo_apa said: Estou com dificuldades para fazer um script de atendido , quando o player está no marcador os dx ao lado do setCameraMatrix são chamados, e quando o backspace é engolido, na teoria era para retirar o EventHandler e voltar tudo ao normal. O cooldown seria evitar um loop. local cooldown = {} function dxConce() if exibindo_painelC == false then if cooldown and (getTickCount() - cooldown) < 5000 then return end cooldown = getTickCount() addEventHandler("onClientRender", root, drawConce) exibindo_painelC = true bindKey('backspace','down', function() if exibindo_painelC == true then removeEventHandler("onClientRender", root, drawConce) setCameraTarget (localPlayer) exibindo_painelC = false end end) end end Try this then Edited November 26, 2022 by shishani Link to comment
Murilo_apa Posted November 26, 2022 Author Share Posted November 26, 2022 the element comes from the server side script when the element is on the marker. function dxConce() if exibindo_painelC == false then if cooldown[element] and tick - cooldown[element] < 5000 then return end cooldown[element] = tick -- this line addEventHandler("onClientRender", root, drawConce) exibindo_painelC = true bindKey('backspace','down', function() if exibindo_painelC == true then removeEventHandler("onClientRender", root, drawConce) setCameraTarget (localPlayer) exibindo_painelC = false end end) end end 16 minutes ago, shishani said: You did not answer my question local cooldown = {} local tick = getTickCount() function dxConce() if exibindo_painelC == false then if cooldown and tick - cooldown < 5000 then return end cooldown = tick addEventHandler("onClientRender", root, drawConce) exibindo_painelC = true bindKey('backspace','down', function() if exibindo_painelC == true then removeEventHandler("onClientRender", root, drawConce) setCameraTarget (localPlayer) exibindo_painelC = false end end) end end Try this then does not work Link to comment
mafioz Posted November 26, 2022 Share Posted November 26, 2022 (edited) local cooldown function dxConce() if exibindo_painelC == false then if cooldown and (getTickCount() - cooldown) < 5000 then return end cooldown = getTickCount() addEventHandler("onClientRender", root, drawConce) exibindo_painelC = true bindKey('backspace','down', function() if exibindo_painelC == true then removeEventHandler("onClientRender", root, drawConce) setCameraTarget (localPlayer) exibindo_painelC = false end end) end end Sorry, I do not know English, and with the help of a translator, I did not quite understand you. last try Edited November 26, 2022 by shishani Link to comment
Murilo_apa Posted November 26, 2022 Author Share Posted November 26, 2022 4 minutes ago, shishani said: local cooldown function dxConce() if exibindo_painelC == false then if cooldown and (getTickCount() - cooldown) < 5000 then return end cooldown = getTickCount() addEventHandler("onClientRender", root, drawConce) exibindo_painelC = true bindKey('backspace','down', function() if exibindo_painelC == true then removeEventHandler("onClientRender", root, drawConce) setCameraTarget (localPlayer) exibindo_painelC = false end end) end end Sorry, I do not know English, and with the help of a translator, I did not quite understand you. last try Brooooh! you're a god ┗|`O′|┛ Thank you veeeery much for your patience and sorry for the lack of information! LOV U Link to comment
mafioz Posted November 26, 2022 Share Posted November 26, 2022 If more issues come up, create a new thread and tag me. I'll be glad to help! 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