• Hey! Register here to create your account, engage with the community, and talk about what is new!

How do I make random spawn points for a PvP game?

MyroDock

New member
Joined
Feb 25, 2023
Messages
1
Reaction score
0
How do I make random spawn points for a PvP game? What's the code?
 
Solution
You can use Set Variable: Set To Random, that sets the variable to a random parameter, to do it:

When you want to spawn the player, place a Set Variable: Set To Random (should be in the first category), in the 1st slot put a variable (preferably a LOCAL one), let's call it tp_loc, and in the rest of the chest, you can put your locations of the expected spawn points. Then place a Player Action: Teleport and put the same tp_loc variable in the 1st slot and you should be good to go.

You can make the locations totally random using other blocks, but I don't recommend it as the player may spawn in an impossible to reach location, or in lava or water or stuff like that.

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,260
Reaction score
356
You can use Set Variable: Set To Random, that sets the variable to a random parameter, to do it:

When you want to spawn the player, place a Set Variable: Set To Random (should be in the first category), in the 1st slot put a variable (preferably a LOCAL one), let's call it tp_loc, and in the rest of the chest, you can put your locations of the expected spawn points. Then place a Player Action: Teleport and put the same tp_loc variable in the 1st slot and you should be good to go.

You can make the locations totally random using other blocks, but I don't recommend it as the player may spawn in an impossible to reach location, or in lava or water or stuff like that.
 
Solution
Top Bottom