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

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

Asked by 10 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
10 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 — 10y
0
Should now. HexC3D 830 — 10y
Ad

Answer this question