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

How to edit player when clicked?

Im talking about click detector problem. The problem is that i want to make a button that teleports you. BTW i have a teleport script so im asking only for a way to make click detector that edits player. (I think that it can be the same as gui local player) Pls write in comments :p)

1 answer

✓ Accepted answer

To teleport a player using a ClickDetector, you can do this:

local ClickDetector = script.Parent:WaitForChild("ClickDetector")

ClickDetector.MouseClick:Connect(function(Player)
	local Character = Player.Character
	if Character then
		-- Teleport player
	end
end)

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