Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make a "Jump to respawn" script when i die? [closed]

Asked by 4 years ago
Edited by M39a9am3R 4 years ago
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)


0
Edited for code block. M39a9am3R 3210 — 4y
0
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. greatneil80 2647 — 4y
0
im very new to coding, sorry snowythebunny129AL -5 — 4y

Closed as Non-Descriptive by DeceptiveCaster

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?