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

im trying to make this text button teleport me to another place how do i do this?

Asked by 4 years ago

here is my script

local button = script.Parent
local tp = game.GetService("TeleportService")
local place2 = 4818533596

local player = game.Players.LocalPlayer
if button.MouseButton1Click then
    tp:Teleport(place2,player)
end
0
Is it a LocalScript? Geobloxia 251 — 4y
0
yes Ninjalord1003 2 — 4y

1 answer

Log in to vote
0
Answered by
Lakodex 711 Moderation Voter
4 years ago
Edited 4 years ago

You can't just use "if button.MouseButton1Click then". You must activate it, use this below and every time you click the button it'll run a function and then teleport the player!

button.MouseButton1Click:Connect(function()
    tp:Teleport(place2,player)
end)
Ad

Answer this question