local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
local placeId = 1324061305 -- replace here
local loadingGui = ReplicatedStorage:FindFirstChild("LoadingGui") -- replace here
-- parent the loading gui for this place
loadingGui.Parent = playerGui
-- set the loading gui for the destination place
TeleportService:SetTeleportGui(loadingGui)
-- teleport the user
script.Parent.MouseButton1Click:Connect(function()
TeleportService:Teleport(placeId)
end)
1 Like