@name Fast Forest Spawner
@inputs 
@outputs Count Trees:array 
@persist Count Model:string Spawn:vector C Delete Freeze
interval(20)
#Model="models/props_foliage/tree_deciduous_01a.mdl" #HL2 Only
#Model="models/props_foliage/oak_tree01.mdl" #mighty Oak HL2 only
#Model="models/props_foliage/tree_deciduous_01a-lod.mdl" #HL2 Only Standing
#Model="models/props_foliage/tree_pine_01.mdl" #Episode 1
Model="models/props_foliage/tree_pine04.mdl" #Episode 2
if(first()|duped()){Count=0 Trees=array() Freeze=0}
Max = 25
if (Count<Max) {
D = random(0,360)
R = random(20,1500)
Spawn = entity():pos()+vec(R*cos(D),R*sin(D),5)
if (Spawn:isInWorld()) { 
#ifdef propSpawn(string,vector,number)
    Tree=propSpawn(Model,Spawn,Freeze)
#else
    Tree=entitySpawn("prop_physics",Spawn,Freeze)
    Tree:setModel(Model)
#endif
Trees[Count,entity]=Tree
Count++
}}
runOnChat(1)
K=chatClk()
if(entity():owner():name()==""){Delete=1}
Chat=entity():owner():lastSaid()
Anti=Chat:find("Lumberjack")
if(Anti&K){Delete=1 C=0}

#ifdef entity:propDelete()
while(Delete&(C<Max)){
    Trees[C,entity]:propDelete() 
    #Trees:
    C++
}
#else
    print("Cannot autodelete trees! PropCore is not installed!")
#endif
if(Delete&C==Max){selfDestruct()}







