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

How to Make people teleport to map from lobby after intermission?

Asked by
Rukory 0
10 years ago

When i tried to do it, it doesnt work for me this is my script

for i,v in pairs(game.Players:getChildren()) do if v:findFirstChild("Character") then v.Character.Torso:MoveTo(0,0,0) -- change this to a position within the lobby end end

1 answer

Log in to vote
0
Answered by 10 years ago

Don't use the torso ("Torso:MoveTo(0,0,0)"), also why "0, 0, 0"? Is your spawn point located in X:0, Y:0, Z:0? Also "MoveTo" need a new Vec3 instance, like this: "MoveTo(Vec3.new(x, y, z))" Use the player position or the Character position (so MoveTo needs to be on "Character") like this:

for i, player in pairs (game.Players:GetChildren()) do
    if player:FindFirstChild("Character") then
        player.Position = Vec3.new(x, y, z)
        -- OR
        player.Character:MoveTo(Vec3.new(x, y, z))
    end
end
Ad

Answer this question