I wrote a script that makes the character play an animation upon death, however the humanoid.Died state sometimes does not fire or fire a few seconds after humanoid is at 0 health. I have tried using humanoid.HealthChanged instead but it also did not fire. Here is my script:
humanoid.Died:Connect(function()
Track:Play()
Track.Stopped:Connect(function()
ragdoll() --ragdoll script worked, most likely not the cause
end)
end)
I’m expecting the “died” event to fire the moment the humanoid’s health is depleted.
In addition: if the player zooms into 1st person and looks around while the humanoid’s health is 0 the “died” event will magically fire.
I am trying to avoid the use of RemoteEvents because I can’t think of an effective way to prevent hackers to exploit it [the remote events] and ragdoll random people
I have already tried this method and have stated the results above
Currently the only effective way I found to achieve my objective was to listen on the client side and replicate it to the server using remote events (also this topic is solved thx for trying to help)