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

Problem with model counter?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

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

0
also you dont need two loops ProfessorSev 220 — 9y
Ad

Answer this question