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

Firing a function not working? I dont understand at all the problem. [Solved]

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

0

you will need to post the entire code so we can see the problem

0

Are you sure? I feel as if that may confuse people. Or remove from the focus.

0

Are you getting any errors? or warnings? Are you sure its finding EnemiesLeft?

0

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

0

is an int value*

0

Yeah there arent any errors. Its weird.

0

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.

0

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.

0

I know, that means that the EnemiesLeft value isn't even being changed.

0

https://codeshare.io/amD8EX There is a link to the full code. I dont know what the problem is.

0

Check the part of your script where you change that value.

0

I change it manually and it still doesn't run the function

1 answer

✓ Accepted answer

Hey sorry, my computer crashed. I'm back now though.

Since the problem was switching to the server in studio, would you mind accepting this as the answer?

Thanks brotha and goodluck!

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