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

Universe teleport GUI, I have the GUI, but can't figure out the script. Help?

I want to provide a menu UI to provide users an easy, streamlined method of transportation between games in my universe, and have it all created and laid out... Except for the place teleport code. I know it needs to call a local onclick() get.Parent and teleportservice but am unsure on how to create it to make it functional. Can anyone help?

2 answers

✓ Accepted answer

Teleports are controller with one simple service, TeleportService! The most important part of this service would be the Teleport method. Here's an example of how to do it when a button is clicked:

local placeId = 0 -- Change this to the ID of the place
local button = script.Parent -- Change this to wherever the button that will be clicked is

button.MouseButton1Click:connect(function() -- When the button is clicked
	game:GetService("TeleportService"):Teleport(placeId) -- Teleport them!
end)

1 comment

1

Thanks a ton! Got it to work with a few modifications to make it go to the UI buttons, but nothing too hard.

Button.MouseButton1Click:connect(function()
	game:GetService("TeleportService"):Teleport(Game ID, Player)
end)

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