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 Make When a clickDetector is clicked It will Teleport the Player?

I was doing a game about Hangout, But Then I understood something, I was using this script:

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	script.Parent.SurfaceGui.TextLabel.Text = "Has Been Occupied For 8 Minutes"
	script.Parent.ClickDetector:Destroy()
	wait(480)
	script.Parent.SurfaceGui.TextLabel.Text = "Disabled for 30 Seconds"
	wait(30)
	local Clone = game.ReplicatedStorage.ClickDetector
	Clone.Parent = script.Parent
	script.Parent.SurfaceGui.TextLabel.Text = "Waiting For Player..."
	wait(0.1)
	local Clone2 = Instance.new("ClickDetector")
	Clone2.Parent = game.ReplicatedStorage
end)

Then i realised that i needed to use a teleport Script.

2 answers

where do you want it to be teleported to please be more specific you can dm me on discord #Blue Duck#8344

Make a brick then put a click detector and a script in it and in the script write this:

local CD = script.Parent.ClickDetector

CD.MouseClick:connect(function(Player)
	Player.Character:SetPrimaryPartCFrame(CFrame.new(X,Y,Z))
end) 

then change X Y Z to the x y z you want the player to teleport to

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