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

How to make teleport all player without me?

hi, i know how to teleport all player but idk how without me teleport, i making map in studio, and i need it

this script for all teleport

local player = game.Players:GetPlayers()

for i = 1, #player do 
    player[i].Character:MoveTo(Vector3.new(0,2,0))
end

2 comments

0

Put the code in code block and in the question. Don't answer your question with the codes

0

Please accept my answer if that works.

2 answers

Easy:

local player = game.Players:GetPlayers()

for i = 1, #player do 
    if player[i].Name == "yourname" then
		--you will not be teleported
	else
		player[i].Character:MoveTo(Vector3.new(0,2,0))
	end
end

You just need to detect if the player's name is you, if yes, not do anything, if not, teleport the player to somewhere

First of all, Character is a property, so if you're going to teleport the player use the HumanoidRootPart. Second, MoveTo() makes the Humanoid walk to the location most of the time.

Fix:

local plrs = game.Players:GetPlayers()
for i = 1, #plrs do
	if plrs[i].Character.HumanoidRootPart ~= nil then
		if plrs[i].Name ~= "SerrTV" then
			plrs[i].Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(0,2,0))
		end
	end
end

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