ODutii Posted August 17, 2019 Share Posted August 17, 2019 Qual o script, para quando eu ficar pressionando a tecla a animação continue, e quando eu soltar a animação para? Eu fiz um projeto, más ele so funciona se apertar. addEventHandler("onResourceStart", resourceRoot, function() for i, player in ipairs(getElementsByType("player")) do bindKey(player,"m", "down", "sit") end end) function toggleSit(thePlayer) if seat == false then setPedAnimation(thePlayer, "ped", "IDLE_taxi", -1, false, false, false, false) seat = true elseif seat == true then setPedAnimation(thePlayer) seat = false end end addCommandHandler("sit", toggleSit) Link to comment
Tommy. Posted August 17, 2019 Share Posted August 17, 2019 Tente isso, não é a melhor maneira mas deve funcionar. addEventHandler("onResourceStart", resourceRoot, function() for i, player in ipairs(getElementsByType("player")) do bindKey(player,"m", "down", toggleSit) bindKey(player,"m", "up", toggleSit) end end) function toggleSit(thePlayer) if seat == false then setPedAnimation(thePlayer, "ped", "IDLE_taxi", -1, false, false, false, false) seat = true elseif seat == true then setPedAnimation(thePlayer) seat = false end end Não testei! Link to comment
#DeltaSCR Posted August 18, 2019 Share Posted August 18, 2019 (edited) O estado both não funcionaria nesse seu caso não? Edited August 18, 2019 by #DeltaSCR Link to comment
ODutii Posted August 26, 2019 Author Share Posted August 26, 2019 (edited) On 18/08/2019 at 18:45, #DeltaSCR said: O estado both não funcionaria nesse seu caso não? Como assim ? Edited August 26, 2019 by ODutii 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