So I need help with trying to make the exit button so when the player jumps off It teleports them back to spawn The code is in the bottom for the Exit Button Gui Its like in Camping games and story type of games here is a video of what I am talking about
Uploading: Screen Recording 2020-04-28 at 11.00.20 AM.mov…
Thanks
local player = script.Parent.Parent.Parent.Parent
local TeleportPoint = game.Workspace.TeleportPoint
script.Parent.MouseButton1Click:Connect(function()
player.Character.Humanoid.Sit = false
wait(0.5)
player.PlayerGui.ExitGui:Destroy()
player.Character.HumanoidRootPart.CFrame = Spawns [math.random(1,12)].CFrame
player.Character.Humanoid.JumpPower = 50
player.Character.Humanoid.WalkSpeed = 16
end)