while wait(.03) do mods = 0
for i,v in pairs (workspace:GetChildren()) do if v:IsA("Model") then if v.Name == "BC" then mods = mods + 1 end end end game.ReplicatedStorage.MaxNPCLimit.Value = mods end
Why does it say 0?
while wait(.03) do mods = 0
for i,v in pairs (workspace:GetChildren()) do if v:IsA("Model") then if v.Name == "BC" then mods = mods + 1 end end end game.ReplicatedStorage.MaxNPCLimit.Value = mods end
Why does it say 0?
because you are setting mods to 0 everytime it loops try declaring it outside of the loop
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
also you dont need two loops