Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Teleporting players not working?

Hi, in my script there's a line of code that makes all the players teleport in a game, the teleport is random because the possible teleports are in a table and i'm using math.random. But it's only teleporting the players to 0,0,0. Can you help?

local spawns = {Vector3.new(0,0,0,300),Vector3.new(0,0,0,400),Vector3.new(0,0,0,500)}
player.Character.Torso.CFrame = CFrame.new(spawns[math.random(1, #spawns)])

1 answer

✓ Accepted answer

Vector3 only has 3 values: X,Y,Z. I see there are 4.. That's your issue.

This discussion is preserved as it was. New answers, comments, and votes are closed.