jlulian38's magic
public lua v1 · immutablelastragcount = 0function thinkShit() local ragcount = 0 for i=1,4096 do local ent = ents.GetByIndex(i) if ent:IsValid() then if ent:GetClass() == "prop_ragdoll" then ragcount = ragcount + 1 end end end if ragcount > lastragcount then --do your shit here end lastragcount = ragcountend