0xNull Posted March 10, 2018 Posted March 10, 2018 I have such code: var countplayers=0; var launch=0; mp.events.add('playerJoin', (player) => { player.robber = 0; player.ingame = 0; player.hello = 0; }); mp.events.addCommand('chase', (player) => { if (countplayers == 0){ if (player.ingame== 0 && launch == 0){ player.robber = 1; player.ingame = 1; countplayers +=1; setTimeout(startmp, 10000); }} else { if (launch == 0 && player.ingame == 0){ player.hello = 1; player.ingame =1; console.log(player.hello); } } function startmp(){ console.log(player.hello); launch = 1; } }); Befor function "startmp" - variable player.hello = 1. After - for some reason - variable player.hello = 0. Why? Though variable player.robber = 1
mickmelon Posted March 10, 2018 Posted March 10, 2018 (edited) 09789ty Edited April 4, 2022 by mickmelon
Xabi Posted March 10, 2018 Posted March 10, 2018 You're defining the function inside the command, not sure how that will work.
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