When the zombie dies it doesn't change the value
local zombiesleft = workspace.RoundSYSTEM.ZombiesLeft.Value while true do wait(0.001) script.Parent:WaitForChild("Humanoid").Died:Connect(function() print('Zombie Died') zombiesleft -= 1 script:Destroy() end) 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 :
local zombiesleft = workspace.RoundSYSTEM.ZombiesLeft while true do wait(0.001) script.Parent:WaitForChild("Humanoid").Died:Connect(function() print('Zombie Died') zombiesleft.Value -= 1 --not sure of the syntax over here you can also use --zombiesleft.Value = zombiesleft.Value - 1 script:Destroy() end) end
Now it might work ! Hope this helped :)