Exit Button in Camping Games

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)

Wait so whats the problem that you’re asking here?

2 Likes

If you could elaborate on the problem and perhaps provide some examples of what you’re trying to achieve , it will make it easier for others to help you out.

1 Like

Thank you I tried uploading a video but Failed