Ahmed Abo-elezz Posted December 11, 2014 Share Posted December 11, 2014 please i want whan i press key F1 stay do fuction again and again.. and whan up key then stop this is code server function bindTheKeys2(player) local x, y, z, rx, ry, rz = getElementAttachedOffsets (car1) attachElements ( car1, vehicle [ player ], x, y, z, rx, ry, rz+1 ) end function bindTheKeysd ( player, commandName ) bindKey ( player, "F2", "down", bindTheKeys2 ) end addCommandHandler ( "bindme", bindTheKeysd ) Link to comment
WASSIm. Posted December 11, 2014 Share Posted December 11, 2014 local render = { } function bindTheKeys2(player, key, stats) if (stats == "down") then render[player] = setTimer(function(player) local x, y, z, rx, ry, rz = getElementAttachedOffsets (car1) attachElements ( car1, vehicle[player], x, y, z, rx, ry, rz+1) end, 50, 0, player) elseif (stats == "up") and (isTimer(render[player])) then killTimer(render[player]) render[player] == nil end end function bindTheKeysd(player, commandName) bindKey(player, "F2", "both", bindTheKeys2) end addCommandHandler("bindme", bindTheKeysd) 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