monamour Posted January 28, 2018 Share Posted January 28, 2018 hello everybody, am trying to edit the [play] gamemode to force the players to press "R" for example to spawn after they wasted. what should i do here: addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 1800, 1, source) end ) i understand that i should replace setTimer with bindkey(spawn , "R", "source" ) bit it still doesnt work. can anybody help me please? Link to comment
NeXuS™ Posted January 28, 2018 Share Posted January 28, 2018 bindKey has different arguments. Check the wiki page. 1 Link to comment
monamour Posted January 28, 2018 Author Share Posted January 28, 2018 22 minutes ago, NeXuS™ said: bindKey has different arguments. Check the wiki page. i've already read them but still confused which arguments should i use , can you please correct the bindkey line for me? Link to comment
NeXuS™ Posted January 28, 2018 Share Posted January 28, 2018 Not tested, if you get any errors. just reply. function respawnHandler(keyPresser) spawn(keyPresser) unbindKey(keyPresser, "r", "down", respawnHandler) end addEventHandler("onPlayerWasted", root, function() bindKey(source, "r", "down", respawnHandler) end ) 1 Link to comment
monamour Posted January 28, 2018 Author Share Posted January 28, 2018 33 minutes ago, NeXuS™ said: Not tested, if you get any errors. just reply. function respawnHandler(keyPresser) spawn(keyPresser) unbindKey(keyPresser, "r", "down", respawnHandler) end addEventHandler("onPlayerWasted", root, function() bindKey(source, "r", "down", respawnHandler) end ) it's works perfectly!! @NeXuS™ Thank you so much for the help you gave me in this script. I greatly appreciate the assistance you have provided me. 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