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

How do I teleport between places when I press a textbutton?

I want to teleport to another place after pressing a textbutton I have in my StarterGui. How do I do it?

I tried placing a local script inside the textbutton like this:

PlaceId = '1392880606' Game.Players.PlayerAdded:connect(function(player) wait(2) if not player.Character then player:LoadCharacter() end Game:GetService('TeleportService'):Teleport(PlaceId,player.Character) end)

Please anyone knows what can I do?

1 answer

local TeleportService = game:GetService("TeleportService")

local Place = 123456789 -- Put place Id here

local player = game.Players.LocalPlayer

 

script.Parent.MouseButton1Click:connect(function()

TeleportService:Teleport(Place, player)

end)

Put this script inside you're textbutton

6 comments

0

It doesn't work

0

If it does not work ensure that the game is published and active

0

Oh right

0

Did it work?

0

I'm still doing it

0

It didn't work and the place is activated

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