Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to know what happened when the player die? and how to override the die procedure?

I have some problem with some scripts and with some tools, I need to know what happened when the player die, of course the player respown, but I need to know what esactly happned, and if is posible change some of this procedures.

If some know where to get this information is going to be great.

any help will be appreciated.

2 answers

✓ Accepted answer

When someone dies, Roblox fires their humanoid.Died event if possible. You can connect this event to a function to do something upon death. Then, it waits 5 seconds (probably changeable), and essentially calls the Players:LoadCharacter() function. A model is created, assigned to the player, loads the typical parts, then loads their appearance. PlayerGui and Backpack are reset.

Countless events, properties, etc are changed, so this is a simple process but not easy to totally replicate. But yes you can take some control. You can toggle the variable game.Players.CharacterAutoLoads, then easily call Player:LoadCharacter() or Player:RemoveCharacter() whenever you want. You can also manipulate character appearance with the many properties listed in Player and Humanoid. Lastly you can disable Reset Character by running game:GetService("StarterGui"):SetCore("ResetButtonCallback", false). Have fun

Local Died = game.Players.LocalPlayer.Character.Humanoid.Health = 0
if Died then

and the only way to overright the death system is to put them ina place where people cant kill them disable the reset button or make their health math.huge but non of these are really good since guessing you are making a rpg immortallity in the middle of combat is too good

This discussion is preserved as it was. New answers, comments, and votes are closed.