I have this basic function that doesnt seem to be firing, there arent any errors either. What am I doing wrong?
function WaveCompleted()
print(0)
if RoundStats.EnemiesLeft.Value == 0 then
print(1)
SetupWave()
end
end
RoundStats:WaitForChild("EnemiesLeft").Changed:Connect(WaveCompleted)
It doesnt print and I have an unseen spawn(function()) above this code that has a while loop in it but i dont think thats the problem since its in a spawn function.
Does anyone have any ideas?

12 comments
you will need to post the entire code so we can see the problem
Are you sure? I feel as if that may confuse people. Or remove from the focus.
Are you getting any errors? or warnings? Are you sure its finding EnemiesLeft?
Also, if EnemiesLeft if an int value, you can pass that new value as a parameter of the function and just check if that is == to 0
is an int value*
Yeah there arent any errors. Its weird.
The only potential problem i can see is that, maybe the value isn't actually being changed. Check the value to see if it is even being changed.
PoePoe it doesnt even print the first 0 like the first print statement so like it isnt even firing. Ive never had this problem before.
I know, that means that the EnemiesLeft value isn't even being changed.
https://codeshare.io/amD8EX There is a link to the full code. I dont know what the problem is.
Check the part of your script where you change that value.
I change it manually and it still doesn't run the function