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
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)
This video may help, it includes a Server script, a BUTTON script and more...
https://www.youtube.com/watch?v=VQLIIG1jKdw