Morphing Issue Killing Player

development
scripting
#1

I’m attempting to make a R15 Morph(er). So far I’ve been successful, but sometimes the morph manages to kill the player instead of just morph.

It seems to kill you if you try to morph twice after already morphing; but I can’t really diagnose the specific issue other than that.

(Heres a quick snippet of my code, this is the part only for limbs, not clothes or hats)

Code
    for _, BodyPart in pairs(char:GetChildren()) do
        if (BodyPart:IsA("BasePart")) then
            local EnumBodyPartR15     = humanoid:GetBodyPartR15(BodyPart);
            if (self["RIG"]["BPs"][EnumBodyPartR15]) then
                local NewBodyPart         = Instance.new(self["RIG"]["BPs"][EnumBodyPartR15], nil){Anchored = false};
                humanoid:ReplaceBodyPartR15(EnumBodyPartR15, NewBodyPart);
            end
        end
    end

It seems to be related with the head, but I haven’t been able to find anything else than that.
Thanks for the help!

1 Like

#2

I would recommend making the system so if a player has already morphed, they cannot morph again. If I could see your full code, I could attempt at making that for you. I’d assume that would fix your issue, as for addressing the problem directly, I’m not entirely sure what’s going on. /:neutral_face:

0 Likes

#3

I can confirm that this is an issue. A few months ago I also created an R15 morph system which had some issues regarding killing players randomly.

I tried this as well, and it didn’t seem to help out… The issue for me was the first time a player morphed.
I was using a package ID and got the package assets from AssetService:GetAssetIdsForPackage, then took all the accessories off the player, rebuilt the rig, inserted new limbs (building the rig each time i added a limb) and then reparented the accessories (and rebuilt the rig)…

I rebuilt the rig a lot because it seemed that the success rate was significantly higher when rebuilding the rig.

If it helps you here is a .rblx place that I used to test out my package giverMorphTest.rbxl (20.0 KB)

For me this works flawlessly in test studio, most of the time in game. I suspect that the issue is due to a degree of lag that I have, as in my game (which can get quite laggy) I seemed to die a lot more.

From all of the debugging that I did I could not either diagnose the specific flaw in my code.

(edit) On a side note:

Instance.new(self["RIG"]["BPs"][EnumBodyPartR15], nil){Anchored = false};

Using the second argument on Instance.new is highly advised against. If you want more information, visit PSA: Don’t use Instance.new() with parent argument

1 Like

#4

It looks like the video in your post has expired, and the link is now broken. Please update.

0 Likes

#5

Check out this discussion, I believe Merely has a work around for this posted that solves the removal of the neck joint killing the humanoid.

0 Likes