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?
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)
Button.MouseButton1Click:connect(function() game:GetService("TeleportService"):Teleport(Game ID, Player) end)