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

Teleport A Player?

Asked by 8 years ago
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

Log in to vote
0
Answered by 8 years ago

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

0
MoveTo requires a Vector3 value, all you have to do is tag a .Position to the end of "Spawn". M39a9am3R 3210 — 8y
Ad
Log in to vote
0
Answered by
Phenite 20
8 years ago

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)

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. M39a9am3R 3210 — 8y

Answer this question