\@name FailCake IceBreaker v1
@inputs EGP:wirelink Ply1:wirelink Ply2:wirelink Ply3:wirelink Ply4:wirelink 
@inputs PL1C:wirelink PL2C:wirelink PL3C:wirelink PL4C:wirelink
@outputs [E O Ice]:entity Build P [Rocks Say]:array Cos Sin Start Ok
@persist 
@trigger all 

if(first() | duped()){
runOnTick(1)
runOnChat(1)

Ok = 1
Start = 1

EGP:egpClear()
E = entity()
O = owner()

propSpawnEffect(0)

Ice = propSpawn("models/hunter/blocks/cube8x8x025.mdl",E:toWorld(vec(0,0,118)),ang(0,0,0),1)    
Ice:setMaterial("models/debug/debugwhite")
Ice:setAlpha(180)

holoCreate(1)
holoModel(1,"cube")
holoParent(1,E)
holoPos(1,E:toWorld(vec(0,0,9)))
holoScale(1,vec(46,46,1))
holoMaterial(1,"models/shadertest/shader3")

holoCreate(3)
holoModel(3,"models/props_wasteland/rockcliff01J.mdl")
holoParent(3,E)
holoPos(3,E:toWorld(vec(0,15,25)))
holoScale(3,vec(1,1,1))
holoMaterial(3,"")

holoCreate(4)
holoParent(4,E)
holoColor(4,vec(255,0,0))
holoMaterial(4,"models/wireframe")
holoAlpha(4,0)

E:soundPlay(1,0,"music/portal_self_esteem_fund.mp3")
E:soundPlay(2,0,"ambient/levels/canals/tunnel_wind_loop1.wav")
}

if(chatClk(O)){
Say = O:lastSaid():explode(" ")

if(Say[1,string] == "!start" & Start == 0){
Start = 1    
}
  
}




if(Build){

if(owner():keyUse()){
print("Cos = "+Cos) 
print("Sin = "+Sin)    
}
   
P+=0.3
Cos = cos(P)*180   
Sin = sin(P)*180   

if(P == 0.3){
holoAlpha(4,255) 
}

holoPos(4,Ice:toWorld(vec(Cos,Sin,10)))
timer("create",400)

if(clk("create")){
Spa = propSpawn("models/props_junk/Rock001a.mdl",holoEntity(4):pos(),ang(0,0,0),1)
Rocks:pushEntity(Spa)
}

if(P == 363){
Build = 0
Ok = 1
print("Building Done!") 
holoAlpha(4,0)  
}

}


if(Start & Ok == 1){

    
}
