@name Forest Generator
@persist Z Mdl:string I Rad

interval(300)

if(first())
{
    entity():setColor(0, 0, 0, 0)
    #entity():propNotSolid(1)
    
    Z = rangerOffset(10^5,entity():pos(),vec(0,0,1)):pos():z()
    
    setName("Auto-Door")
    
    Rad = 5000
    
    #Mdl = "models/Items/hevsuit.mdl"
    #Mdl = "models/props/CS_militia/tree_large_militia.mdl"
    Mdl = "models/perftest/gman.mdl"
    #Mdl = "models/props_halloween/jackolantern_01.mdl"
    #Mdl = "models/props_combine/CombineTrain01a.mdl"
}

while(perf() & holoCanCreate())
{
    I++
    local RD = rangerOffset(10^5, (entity():pos() + randvec(-vec(Rad), vec(Rad))):setZ(Z),vec(0, 0, -1))
    local H = holoCreate(I, RD:pos(), vec(1), RD:hitNormal():toAngle() + ang(90 ,0 ,0))
    holoPos(I, H:toWorld(vec(0, 0, H:boxSize():z() / 2.5)))
    holoAng(I, H:toWorld(ang(0, random(-180, 180), 0)))
    #holoScale(I, vec(40))
    #holoModel(I, players()[randint(1, numPlayers()), entity]:model())
    #holoAnim(I, "ACT_GMOD_TAUNT_MUSCLE")
    holoModel(I, Mdl)
    
    holoVisible(I, findPlayerByName("Cyber"), 0)
    holoVisible(I, findPlayerByName("chaq"), 0)
    holoVisible(I, findPlayerByName("macki"), 0)
}
