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

Death animation.

Asked by 10 years ago

How would you remove how your body parts fall apart? Because I was thinking of making a gun script where if you get shot, you do certain animations when you die.

2 answers

Log in to vote
1
Answered by 10 years ago

You can use the Died event and welds, or if animations support it, the Animation object. I don't recall if animations support dead humanoids, though.

0
Like check health, and then play animation. Lem0nzz 5 — 10y
Ad
Log in to vote
0
Answered by 8 years ago

Something like this will probably work. Try it and tinker around.

(Put this into the gun)

game.ReplicatedStorage.Death.Parent = script.Parent.bullet --or whatever you want to call the bullet

(Put this ReplicatedStorage and name it Death)

function onTouched(hit) 
    local d = hit.Parent:GetChildren() 
    for i=1, #d do 
        if (d[i].className == "Motor6D") then 
            d[i]:remove() 
        end 
    end
end 

script.Parent.Touched:connect(onTouched) 
0
Oh never mind. I thought you wanted it to fall apart. Rupestrine 5 — 8y

Answer this question