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

How do I make it when you click a brick it teleports you to a universe?

How do I make it when you click a brick it teleports you to a universe?

Thanks,

  • Vendaz

2 answers

✓ Accepted answer
local teleportToID = 12345 --ID of the place
local brickToClick = script.Parent --Put this in the brick to click.
local ClickDetector = brickToClick:FindFirstChild("ClickDetector") or Instance.new("ClickDetector", brickToClick) --Make sure that we have something to detect the clicks.
ClickDetector.MouseClick:connect(function(player)
    repeat wait(1) until pcall(function() Game:GetService("TeleportService"):Teleport(teleportToID, player.Character) end) --Teleport the player.
end)

1 comment

0

Thanks.

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