Applying the R15 Package Part occassionally kills my NPC

Applying an R15 Package Part occasionally kills my NPC. It happens very rarely and for preventing this from happening I have made a debounce of a few seconds yet it still happens very rarely. The next prevention I can take is to respawn my NPC when it dies incidentally, however, I am asking perhaps there is a solution to this rather than preventing the problem from happening or going about it.

The script I am using is the exact same as the one in the wiki:
https://wiki.roblox.com/index.php?title=R15_Compatibility_Guide#Package_Parts

When changing the package, be sure to call NPC.Humaniod:SetStateEnabled("Dead", false) before changing it and NPC.Humanoid:SetStateEnabled("Dead", true) afterwards. The dying is caused by the UpperTorso or Head parts being destroyed, causing the humanoid to die.

I am currently not doing that and it is still working well, the issue I am having happens very rarely but it still happens, however, I will give your idea a try. Thanks!

The NPC still died after it applied the package parts.

I am also changing the NPC’s animations after I apply the packages, should I be doing the Humanoid:SetStateEnabled when applying the animations as well?

Animations shouldn’t matter, and that’s odd it still killed it.
Sorry, devforum notifications are being really buggy rn.

You can learn a bit more here.

As others would say “Try searching for Threads with the same Topic before posting them so their aren’t redundant Threads thus keeping the forum nice and clean”.

And don’t forget to mark it as solved.

The solution to the topic you linked me to, links to this topic:

This topic has no conclusive solution in my opinion.

I think we have a fix for this in the pipeline.
It should be out sometime in the next week or two.

4 Likes

Well, sort of. The bug we are fixing has something to do with the Humanoid not respecting whether the Dead state is enabled or not when damage is taken on the server.

2 Likes

That’s a life saver.

And I am very sorry about LoadCharacter() incident, I will be more careful.

Glad to hear :grinning:

Well, the one I linked has the Solution to your Problem, and the Solved link has an Explanation of why it happens.

Maybe you might learn a bit more from them so I decided to link it.

1 Like

I am not satisfied with the responses in those threads, I don’t see the solution to my problem there. Thanks anyway. :thinking:

LoadCharacter()? Shivers.

@OP
Yeah, this sounds like a backend bug on Roblox’s part as answered by Clone.

(Off Topic)

This is embarrassing, well I sorta PM CloneTrooper1019 about :LoadCharacter() killing the player
but it’s actually my code. LOL

Basically I copied the script from my old game, I’m working on a new game and I didn’t read everything I just Copied & Pasted it.

It’s a RemoteEvent

:FireServer('LoadCharacter')

and as the name implies I thought it only did that but the truth is

OnServerEvent:Connect(function(plr)
   plr.Character.Humanoid.Health = 0
   wait()
   plr:LoadCharacter
end)

and so I thought :LoadCharacter() was broken

I had a valid reason to kill the player when they first join tho.

2 Likes