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

How can I detect the amount of models in a game every second?

Asked by 9 years ago

MY attempt, which of course didn't work >.>

for i,v in pairs(workspace:GetChildren())
                if v.ClassName == "Model" then
        models = v
        end
end

for i = 1, #v do
script.Parent.Value = i[v]
end

1 answer

Log in to vote
2
Answered by
NotSoNorm 777 Moderation Voter
9 years ago

Some of your syntax is a bit splotchy, I fixed it up for you.

I mean, having a loop might generate a little lag.

while wait(1) do
    numModels = 0

    for i,v in pairs (game.Workspace:GetChildren()) do
        if v:IsA("Model") then
            numModels = numModels + 1
        end
    end

    print(numModels)
end
0
i wanted it every second? laughablehaha 494 — 9y
0
thank you sir :D laughablehaha 494 — 9y
Ad

Answer this question