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

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

Asked by 7 years ago

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

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
7 years ago

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

Ad
Log in to vote
-1
Answered by
farrizbb 465 Moderation Voter
7 years ago
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

Answer this question