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

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

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

2 comments

0

Is it a LocalScript?

0

yes

1 answer

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)

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