Jump to content

Recommended Posts

Spoiler

local function count_prefab(prefab)

if not prefab then return end

local count = 0

for _, v in pairs(GLOBAL.Ents) do

if v.prefab == prefab then count= count+1 end

end

return count

end

This function should work for counting the number of prefabs. Note that if not used in modmain.lua then change GLOBAL.Ents to Ents.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...