Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a Conditional Script where an NPC dies?

I am making a game where there is a "final boss", I'm triyng to make a Script where a Part at the center of the arena we fight him, vanishes so we can enter the room behind it, that Part's name is "Lid" and I've tried to make an Script like this:

(This is literally how I've written it in the Script).

if game.Workspace.Arena.Boss.Humanoid.Health == 0 then

game.Workspace.Arena.Lid.Transparency = 1

game.Workspace.Arena.Lid.CanCollide = false

end

The script doesn't work as expected, what can I do to it to work?

1 answer

✓ Accepted answer

um... you wrote the script wong, that's the problem. the script you wrote will check the hp of the boss when the map just loaded then it stop. you should make a connect function when the boss die. here is an example:

game.Workspace.Arena.Boss.Humanoid.Died:Connect(function(

game.Workspace.Arena.Lid.Transparency = 1

game.Workspace.Arena.Lid.CanCollide = false

end)

2 comments

0

Thanks :DDDDDD I've finally completed this part of the game... I'm so- excited, thank you, seriously, thank you!

0

You should mark the answer as solution

This discussion is preserved as it was. New answers, comments, and votes are closed.