mouse = game.Players.LocalPlayer:GetMouse()
local player = game.Players.LocalPlayer
repeat wait() until player.Character
mouse.KeyDown:connect(function(key)
if tostring(key) == "r" then
player:LoadCharacter()
end
end)
COMMUNITY QUESTION
How do i make a "Jump to respawn" script when i die?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Edited for code block.
https://developer.roblox.com/api-reference/event/UserInputService/InputBegan
LoadCharacter doesn't work in localscripts, if you want a player to respawn after they jump, right after they die, you don't use keydown, you use .Died:Connect(function() and you use LoadCharacter() from server, which means you have to recode everything for it to be server-sided, enjoy my brief explanation, I hope this comment helped.
im very new to coding, sorry