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

Problem with model counter?

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?

1 answer

because you are setting mods to 0 everytime it loops try declaring it outside of the loop

1 comment

0

also you dont need two loops

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