@name Croc's Box e2
@inputs 
@outputs 
@persist E:entity PI Y R
@trigger 

if(first()){T = 1
    holoCreate(1)
holoModel(1,"square")
holoColor(1,vec(255,20,20))
    }
runOnTick(10)
runOnChat(1000)
if (chatClk(owner())) {
    Array = owner():lastSaid():lower():explode(" ")   
    if (Array[1,string] == "/crate") {
ENT = owner():aimEntity()
OwnerAim = owner():aimEntity()
hideChat(1)
MODEL = OwnerAim:model()
gSetStr(1,MODEL)
ENT:propDelete()
E = propSpawn("models/props_junk/wood_crate001a.mdl",ENT:pos(),0)
holoParent(1,E)
holoPos(1,E:toWorld(vec(20,0,5)))
PI2 = round(ENT:angles():pitch())
        Y2 = round(ENT:angles():yaw())
        R2 = round(ENT:angles():roll())
E:setAng(ang(PI2,Y2,R2))
}}
Distance = 200
timer("check",100)
if (clk("check")) {
    findInSphere(E:pos(), Distance)
    Array = findToArray()
    for(I=1,Array:count()) {
        if(Array[I,entity]:isPlayer()) {
            if(Array[I,entity]:isAlive()) {               
    P = findClosest(entity():pos())
    Use = P:keyUse()
    if(changed(Use)){
       if(T == 0){
         PI = round(E:angles():pitch())
        Y = round(E:angles():yaw())
        R = round(E:angles():roll())
G = propSpawn(gGetStr(1),E:pos(),1)
G:setAng(ang(PI,Y,R))

T = 0
E:propBreak()
timer("T",1000)
}}}}}}
if(clk("T")){T = 1}
