Increment not setting to 1

So this function is called from the Players.PlayerAdded event and the Increment IntValue is not setting to 1. Line 6 is not working

Because line 2, you are setting the parent of Statistics to be Statistics

But the name is lowercase and they are different

Nope, that is Capital statistics.


I changed the name but line 6 still doesn’t work

Try printing the parent and value of Increment after creating it. See what it prints out.

I get what’s the problem here: when Clicker was created and parented into Increment the value was still 0 before it changed into 1 which fires the child.Changed event and divide-setting the oldvalue into increment which makes it 0

Thank you, it helped me see what was wrong