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

How do I teleport all players except me to a part?

Hey guys, I'm trying to teleport every player to a part but NOT me but idk how to. Heres what I have:

while wait() do

for _, player in pairs(game.Players:GetPlayers()) do player.Character.HumanoidRootPart.CFrame = game.Workspace.kah.CFrame end end

So this teleports all players including me to a part thats named kah. But I want it to teleport all OTHER players. NOT me.

If you can help, thanks!

1 comment

0

why did u put your code in a Quote?

2 answers

#What to do?

  1. Check if the Players UserId is Your UserId
    • I say UserId cause if you change your username it will still work
  2. If the UserId is not your UserId then teleport #Final Script I'm not giving you any script because i want you to learn how to script. If i just gave you a script you are not going to learn from it.

Also, Why did u put your script inside a quote like this?

-- It should be like this

This should work (another way to do it)

while wait() do

for _, plr in pairs(game.Players:GetChildren()) do
	local char = plr.Character
	if char.Name ~= "BiIIyMarchiafava" then
		char:MoveTo(game.Workspace.kah.Position)
	end
end
end

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