@name Cube 
@inputs 
@outputs 
@persist Player:entity Freeze:entity
@model models/Items/item_item_crate.mdl
interval(10)
if(first()){
    hint("!box [name]",5)
    hint("after boxing use -freeze to freeze them",5)
}
A = owner():lastSaid():explode(" ") 
Target = findPlayerByName(A:string(2))
if (Target:isPlayer()){
Player = Target
}
LastSaid=owner():lastSaid()  
if (A:string(1)=="!box"){
    hideChat(1)
    runOnChat(1) 
    holoCreate(1)
}

    holoPos(1, Player:pos() + vec(20,20,20))
    holoScale(1, vec(-20,20,20))
    holoColor(1, vec(random(255),random(255),random(255)),255)
    holoParent(1,Player)
    holoModel(1,"cube2")
    

if(duped())
{
    selfDestructAll()
}
if(changed(LastSaid=="!remove")&LastSaid=="!remove"){
    hideChat(1)
    selfDestruct()
}
if(changed(LastSaid=="-freeze")&LastSaid=="-freeze"){
    hideChat(1)
    Freeze = propSpawn("models/hunter/misc/sphere375x375.mdl",Player:pos()+(vec(0,0,0)),owner():eyeAngles(),1)
Freeze:setAlpha(0)
}
    
