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
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
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.