Alright, not often I come here about an issue with my scripts, but this has just baffled me.
This is basically the gist of it:
My character dies
The Humanoid.Died event doesn’t fire.
When I zoom into first person, the event does fire.
This feels like a Roblox glitch because none of my scripts (yet) manipulate the camera in any way.
local function NewCharacter(Character)
print("Character Added")
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Died:Connect(function()
print("Died")
DeathModule.Death(Character,DeathEffect)
end)
end
The NewCharacter function is fired the way you would expect; “Character Added” is posted into the output upon spawning.
However when I die, “Died” does not appear until I zoom into first person.
The character and everything in the character is up to date - it only looks old as that’s the style I was going for.
DeathModule is not what’s interfering with the script, as when I remove all references to it, the same problem occurs.
I’m left with no solution to this problem, it would be odd to force the player into first person for a split second to activate the Died event because this should definitely be happening on it’s own.
I massively appreciate any help that comes my way!
This script does not detect when the humanoid died, the FX.Death is called when Humanoid.Died is fired, however, this works all fine as soon as I zoom into first person.
Sadly I wasn’t able to find a fix from this, however I did stumble across Breaking Joints, which got my interest.
After a couple of tests I noticed that when BreakJointsOnDeath was set to false, the Character’s death wouldn’t be registered until I entered first person (odd).
However when I set BreakJointsOnDeath to true, the event fired absolutely fine, regardless of RigType, this won’t do as it doesn’t allow my ragdoll to function properly. I’m certain the ragdoll isn’t causing it, as when I removed it with BreakJointsOnDeath set to false, I got the same result.
I’ve also attempted to change the default avatar setting to R6 in the Game Settings menu, no luck.
I’ve tried waiting for health to reach 0, the script just seems to wait a few seconds or until I go into first person, it’s really strange.
Weirdly enough, same issue here.
Ive gotten bug reports that the reset button is unresponsive and slow. I didnt know what that meant, but after testing it, sure enough, it doesnt work properly.
Whats even weirder is that my Died event actually fires, but the character doesnt respawn in time. And the ragdoll script that I have also doesnt always work when you reset. Only the local check for death works.
This is surely a Roblox bug, theres no way its not.
PS Try listening to the Died event on a LocalScript, does it work for you as well? It did for me
EDIT: Try doing this after the Died event on the client fires:
I’ve tried most things from simply using Humanoid.Died, Humanoid:GetState, Humanoid:GetPropertyChangedSignal() and eventually just ended up with a while loop that constantly checks if the health is under one, no luck.
Oh my! It works brilliantly! I think my fix will be to detect death on the client, fire to the server and then check the Health on server for verification (this worked strangely).
There’s no delay on my death effects, either.
(sorry for such a late reply, the dev forums have been down.)
Thanks for the tip! Seems like roblox has a bit of delay on the server. Really strange.
Yeah, its really weird. For me this started happening only recently.
Dont know if this is a Roblox bug or not.
My use case was a little different, what I did was:
Detect death on client
Disable neck
Server detects death
Connect the head back with a ball socket constraint and add all the other ragdoll constraints
I honestly dont know if this is foolproof, but it will do I guess
Glad I could help!