So basically what I wanted to happen was when this "Zombie"'s health is to 0, the zombie will update a set score of how many zombies have been killed, but it wont update :/ ?
1 | wait( 5 ) |
2 | if script.Parent.Zombie.Health ~ = 0 then |
3 | game.Workspace.ZombieKill.Value = game.Workspace.ZombeKill.Value + 1 |
4 |
5 | script.Parent:remove() |
6 | end |
Well for one you need to use a Loop so that is keeps checking, unless this is a bit of the script
1 | while true do |
2 | wait( 1 ) |
3 | if script.Parent.Zombie.Health = = 0 then |
4 | game.Workspace.ZombieKill.Value = game.Workspace.ZombeKill.Value + 1 |
5 | break |
6 | end |
7 | end |
Try this and ~= 0 so then you're telling it to see if heath is NOT 0 so it won't fire OnDeath I recomend using the OnDeath
wiki.roblox.com/index.php?title=API:Class/Humanoid/Died