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

How come this script teleports everyone? Not just the one clicking it?

This script below teleports everyone in the server to the block. Is there a way I can fix that. Post the script below if you figured it out.

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local ProximityPrompt = script.Parent

		ProximityPrompt.Triggered:Connect(function(player)
			char:MoveTo(workspace.teste.Position) -- changed teste to the name of your brick
		end)
	end)		
end)

1 comment

0

Are you using "plr" or "player" you have both. Without defining the player,  ProximityPrompt is being triggered by everyone. 

1 answer

I don't think you need the player added event in there try this:

local ProximityPrompt = script.Parent

ProximityPrompt.Triggered:Connect(function(player)
	local char = player.Character.Humanoid
	char:MoveTo(workspace.teste.Position) 
end)

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