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

Click Detector Game Teleporter?

I am new to roblox scripting and I can't work out how to make use a click detector to teleport you to another game once clicked.

If you could give me steps on how to insert the script and what the script is that would be good

1 answer

Make sure the script is a serverscript, not a local one!

local TeleportService = game:GetService("TeleportService") -- Get the teleport service
local ClickDetector = Instance.new("ClickDetector") -- Creates a click detector
local Part = script.Parent -- The Part or Block
ClickDetector.Parent = Part -- ClickDetector Parent is the Part now

local GameID = 111111111 -- Change this to your game ID

ClickDetector.MouseClick:Connect(function(Player) -- Someone activates the detector, and the argument Player is the player who clicked it
	TeleportService:Teleport(GameID, Player) -- Teleports the player
end)

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