so im trying to make a button that rejoins you when data failed to load.
i already made a gui pop up, and when they click “ok” they should rejoin the game.
this is my script, it should work but when i press it i get this error
local TeleportService = game:GetService("TeleportService")
local Background = script.Parent:WaitForChild("Background")
local RejoinButton = Background:WaitForChild("RejoinButton")
local player = game.Players.LocalPlayer
local PLACE_ID = game.PlaceId
RejoinButton.MouseButton1Click:Connect(function()
game:GetService("TeleportService"):Teleport(PLACE_ID, player)
end)