Viudes Posted September 29, 2017 Share Posted September 29, 2017 local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do bindKey ( aPlayer, "x", "down",SuperStop) end WHy this script not start working when player join? always need to restart script. Link to comment
Addlibs Posted September 29, 2017 Share Posted September 29, 2017 Your code only binds the key to every connected player at the time of starting the script. You also need to add the following event handler: addEventHandler("onPlayerJoin", root, function() bindKey(source, "x", "down", SuperStop) end ) 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