So, my script works perfect the only problem is how can I make the players teleport to the spawn's location but have it offset a little? Here's the part of code I need help with.
Player.Character:MoveTo(Spawn.Position)
So, my script works perfect the only problem is how can I make the players teleport to the spawn's location but have it offset a little? Here's the part of code I need help with.
Player.Character:MoveTo(Spawn.Position)
You can add a few studs to the position by simply adding a Vector3.new() to it. This would look something like this, but with your choice of numbers:
Player.Character:MoveTo(Spawn.Position + Vector3.new(4,0,0))
That would make the character move 4 studs away on the x axis from the spawn position. You could also make it look a little neater by setting the Vector3.new() value as a variable like this:
local offset = Vector3.new(4,0,0)
Player.Character:MoveTo(Spawn.Position + offset)
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
But multiple players will spawn to that location at once so I needed them to spawn within a 15 stud diameter but not directly in the same place I know you can do that with math.random but I'm not sure how
simple, instead of setting offset as a specific set of numbers, set it as Vector3.new(math.random(1, how far you want it to go), 0, math.random(1, how far you want it to go))