djharbi2 Posted April 2, 2018 Posted April 2, 2018 Client-Side addEventHandler("onClientKey",getRootElement(), function(button,press) if press then if (button == "lalt" and getKeyState("k")) or (button == "k" and getKeyState("lalt")) then triggerServerEvent("command:execute",resourceRoot,"up") elseif (button == "lalt" and getKeyState("o")) or (button == "o" and getKeyState("lalt")) then triggerServerEvent("command:execute",resourceRoot,"sit") end end end) Server-Side addEvent("command:execute",true) addEventHandler("command:execute",resourceRoot, function(position) if position=="sit" then animationCommand() elseif position=="up" then animationCommand2() end end) function animationCommand ( source ) setPedAnimation ( source, "ped", "SEAT_idle", -1, true, false, false ) end function animationCommand2 ( source ) setPedAnimation ( source ) end your bass is not working, so I did not help pls
Moderators IIYAMA Posted April 2, 2018 Moderators Posted April 2, 2018 animationCommand(client) animationCommand2(client) function animationCommand ( player ) setPedAnimation ( player, "ped", "SEAT_idle", -1, true, false, false ) end function animationCommand2 ( player ) setPedAnimation ( player ) end Do not abuse the source variable. 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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