Jump when teleporting help?

I have a script where you can teleport back to a specific location when you press a button, simple enough. Although, if you’re sitting in say, a car, it’ll teleport you and the car with you. Any idea on where I need to add the “jump” part?

wait(1)
player = game.Players.LocalPlayer
button = script.Parent
local debounce = false

function teleport()
	if not debounce then
		debounce = true
		Torso = player.Character.Torso
		Torso.CFrame = game.Workspace.SpawnAgain.CFrame
	end
end

button.MouseButton1Click:Connect(teleport)
while true do wait()
	debounce = false
	wait(1)
end

Add the jump right before where you set the Torso’s CFrame. Also, I would recommend using the HumanoidRootPart instead of the torso.

1 Like