Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I teleport to another place with a textbutton? [closed]

Asked by 6 years ago

I want to make my gui's textbutton to teleport to another place. I tried with two scripts, but they didn't work. Please help

0
Please show what you've tried. OldPalHappy 1477 — 6y

Closed as Not Constructive by OldPalHappy

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago

I believe it should look something like this (in a LocalScript that's inside the button):

local placeId = 5847573 --change to place id
script.Parent.MouseButton1Click:Connect(function()
    game:GetService("TeleportService"):Teleport(placeId,game.Players.LocalPlayer)
end)
0
It didn't work FrikiGameplaysHD 1 — 6y
0
Any errors? mattscy 3725 — 6y
Ad