Ad
Log in to vote
0

How to make this open when a boss's health is zero?

Asked by 8 years ago

The boss's name is "Boss" and his humanoid is named "Humanoid" and he is also in Workspace. If anyone can help me, it'd mean a lot to me.

while true do

        for i=1,20 do
            script.Parent.Parent.Lock3.CFrame = script.Parent.Parent.Lock3.CFrame * CFrame.new(0, 1, 0)
            script.Parent.Parent.Lock4.CFrame = script.Parent.Parent.Lock4.CFrame * CFrame.new(0, -1, 0)
            wait(0.01)
        end

        for i=1,20 do
            script.Parent.Parent.Lock3.CFrame = script.Parent.Parent.Lock3.CFrame * CFrame.new(0, -1, 0)
            script.Parent.Parent.Lock4.CFrame = script.Parent.Parent.Lock4.CFrame * CFrame.new(0, 1, 0)
            wait(0.01)
        end
end

1 answer

Log in to vote
2
Answered by
HexC3D 830 Moderation Voter
8 years ago
if game.Workspace.Boss.Humanoid.Health == 0 then



        for i=1,20 do
            script.Parent.Parent.Lock3.CFrame = script.Parent.Parent.Lock3.CFrame * CFrame.new(0, 1, 0)
            script.Parent.Parent.Lock4.CFrame = script.Parent.Parent.Lock4.CFrame * CFrame.new(0, -1, 0)
            wait(0.01)
        end

        for i=1,20 do
            script.Parent.Parent.Lock3.CFrame = script.Parent.Parent.Lock3.CFrame * CFrame.new(0, -1, 0)
            script.Parent.Parent.Lock4.CFrame = script.Parent.Parent.Lock4.CFrame * CFrame.new(0, 1, 0)
            wait(0.01)
        end
wait()






end

Also Health is property of Humanoid if it helps.

+1 if helped.

0
Doesn't appear to work. TheRings0fSaturn 28 — 8y
0
Should now. HexC3D 830 — 8y
Ad

Answer this question