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

How to teleport between places?

Asked by
Lacin1a 12
5 years ago

So I was trying to create a place teleporter in a GUI. I used this but it doesn't seem to work:

 script.Parent.MouseButton1Click:connect(function()

wait(6)

game:GetService("TeleportService"):Teleport(3194743457)

end)

I would like to keep it in a TextButton

0
You need to put in the player you are teleporting in the parameters for Teleport sheepposu 561 — 5y
0
But I want it to be the local player Lacin1a 12 — 5y

2 answers

Log in to vote
0
Answered by
Lacin1a 12
5 years ago

In A Local Script Put This:

local player = game:GetService("Players").LocalPlayer

local TeleportService = game:GetService("TeleportService")

local ReplicatedStorage = game:GetService("ReplicatedStorage")



script.Parent.MouseButton1Down:Connect(function()

wait(2)

TeleportService:SetTeleportGui(ReplicatedStorage:FindFirstChild("TeleportGUI"))

TeleportService:Teleport(PLACEID, player)

end)
Ad
Log in to vote
0
Answered by 3 years ago

This video may help, it includes a Server script, a BUTTON script and more...

https://www.youtube.com/watch?v=VQLIIG1jKdw

Answer this question