So, I ran upon this problem out of the complete blue and it completely confused me.
So this is my code right? There's nothing wrong with it.
local HairNum = 0
Hair.Right.MouseButton1Click:Connect(function()
if HairNum < #game.ReplicatedStorage.Hairs:GetChildren() then
HairNum = HairNum + 1
end
BUT, there is. According to roblox. If I leave
HairNum = HairNum + 1
Like so, HairNum goes up to 1 only and stops. Doesn't go any further beyond 1. If I change it to +2 Instead
HairNum = HairNum + 2
keep in mind it goes up from 2 by 1, not 2. It will go up to 6, once it reaches 6, it will go back to 5, and back to 6, etc.
#game.ReplicatedStorage.Hairs:GetChildren() = 5
It should not go past 5, but I need to be set to +1, but it is not working! I'm not sure if this is on my part or robloxes!

3 comments
I believe it's on your part. If you could help me understand this a bit more, do you just want the hairNum to be the amount of hairs from Hairs:GetChildren() ?
I recommend putting print(HairNum, #game.ReplicatedStorage.Hairs:GetChildren()) after line 4 to confirm what's going on
I actually figured it out, I was being stupid and forgot to change another MouseClick event to a different button, so when i clicked it it detected on both buttons and decreased and increased at the same time. I forgot to close this, apologies.