What I want this script to do is to teleport a player to a certain part of my world. The only problem is is that I don't know how to make sure that the script doesn't only teleport a certain player (Player1) but all people who join the game. For example, when TheGamer101 joins the game, I want TheGamer101 to be teleported. But at the same time, when I join the game, I want to be teleported to the same destination. How do I do that with a script?
Here's the script.
game.Workspace.Player1.Torso.CFrame = CFrame.new(Vector3.new(-4384.4, -397.303, 3167.8))
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character.Torso:MoveTo(Vector3.new(-4384.4, -397.303, 3167.8)) end) end)
Since this was so simple I decided to give you the script. Use MoveTo next time however as it's easier
Here you go good sir, fresh from the land of notepad.
Special_people = {"LOLOLOLOLMRocks37Alt", "TheGamer101"} function Teleport(plr, target) wait() plr.Character.Torso.CFrame = target end Game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) for a,c in pairs(Special_people) do if plr.Name == c then Teleport(plr, CFrame.new(-4384.4, -397.303, 3167.8)) end end end) end)