Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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?

0
you will need to post the entire code so we can see the problem jakebball2014 84 — 5y
0
Are you sure? I feel as if that may confuse people. Or remove from the focus. GottaHaveAFunTime 218 — 5y
0
Are you getting any errors? or warnings? Are you sure its finding EnemiesLeft? PoePoeCannon 519 — 5y
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 PoePoeCannon 519 — 5y
View all comments (8 more)
0
is an int value* PoePoeCannon 519 — 5y
0
Yeah there arent any errors. Its weird. GottaHaveAFunTime 218 — 5y
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. PoePoeCannon 519 — 5y
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. GottaHaveAFunTime 218 — 5y
0
I know, that means that the EnemiesLeft value isn't even being changed. PoePoeCannon 519 — 5y
0
https://codeshare.io/amD8EX There is a link to the full code. I dont know what the problem is. GottaHaveAFunTime 218 — 5y
0
Check the part of your script where you change that value. PoePoeCannon 519 — 5y
0
I change it manually and it still doesn't run the function GottaHaveAFunTime 218 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

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!

Ad

Answer this question