Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Teleporting players not working?

Asked by 8 years ago

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

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
8 years ago

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

Ad

Answer this question