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

Teleport A Player?

for i, v in pairs(game.Players:GetPlayers()) do
v.Character.MoveTo(game.Workspace.Spawn)
end

it only teleports one player not all the players?

2 answers

Here's your fix:

for i, v in pairs(game.Players:GetPlayers()) do
if v:IsA("Player") then
v.Character:MoveTo(game.Workspace.Spawn.Position)
end
end

1 comment

0

MoveTo requires a Vector3 value, all you have to do is tag a .Position to the end of "Spawn".

If you think that you can move the torso with a Vector3 value, then don't. The Torso loses all of its connectors to the other limbs and you die.

Use a CFrame value, as they are smoother and more flexible than Vector3s.

``game.Workspace.Player.Torso.CFrame = workspace.Spawn.CFrame * CFrame.new(0,5,0)

1 comment

0

Your script won't work. It would only work in Studio Test Mode. Also, the method the Questioner was using is correct, the MoveTo function can position a player to a Vector3 area. The Questioner is moving the Character, not the Torso.

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