Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Obviously change these to your area
- local startpos=Vector(0, 0, 0)
- local endpos=Vector(1, 1, 1)
- local interval=0.2 -- You should probably leave this above 0 because I don't know how taxing ents.FindInBox is, but play with it. If 0 works, put it to 0, as that'll be the best thing you can do
- local nextThink=0
- hook.Add("Think", "removeSpawnAreaorWhatever", function()
- if (CurTime()>nextThink) then
- for f,v in pairs(ents.FindInBox(startpos, endpos)) do
- if v:GetClass()=="prop_physics" then
- --Do whatever you want to run before removal here, obviously
- v:Remove()
- end
- end
- nextThink=CurTime()+0.2
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment