When the zombie dies it doesn't change the value
1 | local zombiesleft = workspace.RoundSYSTEM.ZombiesLeft.Value |
2 | while true do |
3 | wait( 0.001 ) |
4 | script.Parent:WaitForChild( "Humanoid" ).Died:Connect( function () |
5 | print ( 'Zombie Died' ) |
6 | zombiesleft - = 1 |
7 | script:Destroy() |
8 | end ) |
9 | end |
The error is on line 1 : I think you want to have access to change the value
property of "ZombiesLeft". What you're actually doing is that you're setting the value to the number of zombies left. By doing this you will get the number of ZombiesLeft. However, you will not be able to change it. The correct way of doing this is :
01 | local zombiesleft = workspace.RoundSYSTEM.ZombiesLeft |
02 | while true do |
03 | wait( 0.001 ) |
04 | script.Parent:WaitForChild( "Humanoid" ).Died:Connect( function () |
05 | print ( 'Zombie Died' ) |
06 | zombiesleft.Value - = 1 --not sure of the syntax over here you can also use |
07 | --zombiesleft.Value = zombiesleft.Value - 1 |
08 | script:Destroy() |
09 | end ) |
10 | end |
Now it might work ! Hope this helped :)