I am doing a map and part of it player will have to decide which of let say 3 steps to step on. 1 is OK and will let them pass and others will kill them.
What I am trying to do is to make random activation to ensure each game start with different step being the safe one.
I tried._G to randomly chose number 1-3 and depending on the number step 1,2 or 3 would be the safe one and the other one would be activated kill script. But this never worked.
There is option to clone map and alter manually steps and just random map at start but this seems counterproductive.
Is there a way to make function choose random number at start of the game (random seed) and depending on the number picked in main script (in workplace or other place?) other local scripts can read this number and decide if part is a killing trap or just a brick?
This would allow me to use one number chosen to determine possible other parts of the game. So the player don't get to remember safe way to pass each time they enter the game.
Aucun commentaire:
Enregistrer un commentaire