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

I need help with something with teleportals? [closed]

Asked by 9 years ago

Well im making a zombie game and I need to know how to teleport players to a new map.

Locked by Shawnyg, SanityMan, and adark

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

There are two ways to teleport players.

  1. character:MoveTo(Vector3.new(#,#,#)) Call the MoveTo() method on a character model.

  2. character.Torso.CFrame = CFrame.new(#,#,#) Change the CFrame of the character's torso.

As for teleporting ALL players, for that we need to use a for loop.

for i,v in pairs(game.Players:GetPlayers()) do
    local character = v.Character
    --teleport stuff
end

Here, we are going through all the players 1 at a time. v equals the player we are currently at. Since v changes to the current player each time the loop iterates, we can affect all players in a very short amount of time.

Hope I helped!

0
I am so confused I got some of it right I think.. UGH hard.. BaconSkillz 0 — 9y
0
What are you confused with? I can try to explain it better. Perci1 4988 — 9y
Ad