@name Refrigerator
@model models/props_interiors/refrigerator01a.mdl
@persist B B2 Speed P:entity 



    
    entity():setAlpha(0)
    holoCreate(0,entity():pos())
    holoModel(0,entity():model())
    holoCreate(1,entity():toWorld(vec(15,-16,0)),vec(0))
    holoModel(2,"models/props_interiors/refrigeratorDoor01a.mdl")
    holoCreate(2,holoEntity(1):toWorld(vec(0.6,16,-7.5)))
    holoModel(2,"models/props_interiors/refrigeratorDoor01a.mdl")
    holoCreate(3,holoEntity(1):toWorld(vec(0.6,16,29.3)))
    holoModel(3,"models/props_interiors/refrigeratorDoor02a.mdl")
    holoCreate(4,entity():pos(),vec(0.7))
    holoModel(4,"models/props_junk/watermelon01.mdl")
    holoCreate(5,holoEntity(4):toWorld(vec(0,0,0)),-(holoScale(4)+0.1),holoEntity(4):angles()-ang(180,180,0))
    holoModel(5,holoEntity(4):model())
    holoMaterial(5,"models/debug/debugwhite")
    holoColor(5,vec(50,255,50))
    
    holoCreate(6,entity():toWorld(vec(3,0,-26.5)),vec(1),entity():angles()) #Melon
    holoModel(6,"models/props_junk/watermelon01.mdl")
    holoCreate(7,entity():toWorld(vec(6.5,-11,-17)),vec(1),entity():angles()+ang(90,0,0)) #Beer
    holoModel(7,"models/props_junk/GlassBottle01a.mdl")
    holoCreate(8,holoEntity(7):toWorld(vec(0,3.5,0)),vec(1),holoEntity(7):angles())
    holoModel(8,"models/props_junk/GlassBottle01a.mdl")
    holoCreate(9,holoEntity(7):toWorld(vec(0,7,0)),vec(1),holoEntity(7):angles())
    holoModel(9,"models/props_junk/GlassBottle01a.mdl")
    holoCreate(10,holoEntity(7):toWorld(vec(-2.8,1.75,0)),vec(1),holoEntity(7):angles())
    holoModel(10,"models/props_junk/GlassBottle01a.mdl")
    holoCreate(11,holoEntity(7):toWorld(vec(-2.8,5.25,0)),vec(1),holoEntity(7):angles())
    holoModel(11,"models/props_junk/GlassBottle01a.mdl")
    
    holoCreate(12,entity():toWorld(vec(6.5,3,-15.25)),vec(1),entity():angles()) #Soda
    holoModel(12,"models/props_junk/popcan01a.mdl")
    holoCreate(13,holoEntity(12):toWorld(vec(0,3.5,0)),vec(1),holoEntity(12):angles())
    holoCreate(14,holoEntity(12):toWorld(vec(0,7,0)),vec(1),holoEntity(12):angles())
    holoCreate(15,holoEntity(12):toWorld(vec(-2.8,1.75,0)),vec(1),holoEntity(12):angles())
    holoCreate(16,holoEntity(12):toWorld(vec(-2.8,5.25,0)),vec(1),holoEntity(12):angles())
    holoModel(13,"models/props_junk/popcan01a.mdl")
    holoModel(14,"models/props_junk/popcan01a.mdl")
    holoModel(15,"models/props_junk/popcan01a.mdl")
    holoModel(16,"models/props_junk/popcan01a.mdl")
    
    holoCreate(17,entity():toWorld(vec(5,-7.5,-2)),vec(0.45),entity():angles()+ang(0,90,0)) #Orange
    holoModel(17,"models/props_junk/PlasticCrate01a.mdl")
    holoCreate(18,holoEntity(17):toWorld(vec(0.9,2.7,0)),vec(1),holoEntity(17):angles())
    holoModel(18,"models/props/cs_italy/orange.mdl")
    holoCreate(19,holoEntity(17):toWorld(vec(-0.9,-2.7,0)),vec(1),holoEntity(17):angles())
    holoModel(19,"models/props/cs_italy/orange.mdl")
    
    holoCreate(20,entity():toWorld(vec(7,2,0)),vec(1),entity():angles()) #Chinafood
    holoModel(20,"models/props_junk/garbage_takeoutcarton001a.mdl")
    holoCreate(21,holoEntity(20):toWorld(vec(0,7.5,0)),vec(1),holoEntity(20):angles())
    holoModel(21,"models/props_junk/garbage_takeoutcarton001a.mdl")
    holoCreate(22,holoEntity(20):toWorld(vec(-7.5,0,0)),vec(1),holoEntity(20):angles())
    holoModel(22,"models/props_junk/garbage_takeoutcarton001a.mdl")
    holoCreate(23,holoEntity(20):toWorld(vec(-7.5,7.5,0)),vec(1),holoEntity(20):angles())
    holoModel(23,"models/props_junk/garbage_takeoutcarton001a.mdl")
    
    holoCreate(24,entity():toWorld(vec(3,-7,10.5)),vec(1),entity():angles()+ang(90,30,0)) #Bananna
    holoModel(24,"models/props/cs_italy/bananna.mdl") 
    holoCreate(25,entity():toWorld(vec(3,6,9.8)),vec(1),entity():angles()+ang(0,-90,0)) #Bannana Bunch
    holoModel(25,"models/props/cs_italy/bananna_bunch.mdl")
    holoCreate(26,entity():toWorld(vec(3,8,26)),vec(1),entity():angles()+ang(40,90,90)) #Milk
    holoModel(26,"models/props_junk/garbage_milkcarton001a.mdl")
    holoCreate(27,entity():toWorld(vec(3,-6,23)),vec(1),entity():angles()+ang(90,90,90)) #Bleach
    holoModel(27,"models/props_junk/garbage_plasticbottle002a.mdl")
    

    
    

    
    holoParent(0,entity())
    holoParent(1,0)
    holoParent(2,1)
    holoParent(3,1)
    holoParent(5,4)
    holoParent(6,entity())
    holoParent(7,entity())
    holoParent(8,entity())
    holoParent(9,entity())
    holoParent(10,entity())
    holoParent(11,entity())
    holoParent(12,entity())
    holoParent(13,entity())
    holoParent(14,entity())
    holoParent(15,entity())
    holoParent(16,entity())
    holoParent(17,entity())
    holoParent(18,entity())
    holoParent(19,entity())
    holoParent(20,entity())
    holoParent(21,entity())
    holoParent(22,entity())
    holoParent(23,entity())
    holoParent(24,entity())
    holoParent(25,entity())
    holoParent(26,entity())
    holoParent(27,entity())


    holoEntity(1):soundPlay(0,0,"ambient/machines/power_transformer_loop_2.wav")
    soundVolume(1,0.7)
    Speed = 3
    B = -Speed

runOnTick(1)
Vec = P:isValid() ? P:pos()+vec(0,0,85) : entity():pos()
B = P:isPlayer() ? Speed : -Speed
B2 = clamp(B2+B,0,120)

if(!P|P:pos():distance(entity():pos())>80|!P:isAlive())
{
    P = findClosest(entity():pos())
    findByClass("player")
    findClipToSphere(entity():pos(),80)
    B=-Speed
}

holoAng(1,entity():toWorld(ang(0,-B2,0)))
holoPos(4,Vec)
holoAng(4,holoEntity(4):angles()+ang(0,3,0)*P:isValid())
holoAlpha(4,255*P:isValid())
holoAlpha(5,holoEntity(4):getAlpha())

