@name Hat Simulator
@inputs XYZ:vector
@outputs Vec:vector Ang:angle Model:string ID
@persist Model:string 
@trigger
O=owner()

runOnTick(1)
Attach="eyes"
ID=O:lookupAttachment(Attach)
#ID=1
Vec=O:attachmentPos(ID)+vec(1.3,-0.0,77)
Ang=O:attachmentAng(ID)
Size=vec(1,1,1)*1
if(first()){
    Model="models/player/items/all_class/skull.mdl"
}
if(first()|(O:aimEntity()&O:keyUse()&O:isCrouch()&Model!=O:aimEntity():model())){
    Model=O:aimEntity():model()
    print(Model)
    holoCreate(1,Vec,Size,Ang)
    holoCustomModel(1,Model,1)
    holoScale(1,Size)
    holoParentAttachment(1,O,Attach)
}


#holoPos(1,Vec)
#holoAng(1,Ang)

