@name HoloGram
@persist  Entity:entity Board:entity Spin Angle On
@trigger all

if(first())
{
    runOnChat(1)
    
    Spin = 1
    On = 1
    Entity = owner()
    holoCreate(0,Entity:pos():setZ(Entity:pos():z()+150))
    holoAng(0,ang())
    holoColor(0,vec())
    holoScale(0,vec(10,1,8))
    Board = holoEntity(0)
#T    
    holoCreate(1,vec(Board:pos():x()+45,Board:pos():y()+2,Board:pos():z()+35))
    holoScale(1,vec(0.4,1,1))
    holoAng(1,ang())
    
    holoCreate(2,vec(Board:pos():x()+45,Board:pos():y()+6,Board:pos():z()+40))
    holoScale(2,vec(1,0.4,0.4))
    holoAng(2,ang())
#H    
    holoCreate(3,vec(Board:pos():x()+35,Board:pos():y()+2,Board:pos():z()+35))
    holoScale(3,vec(0.4,1,1.2))
    holoAng(3,ang())
    
    holoCreate(4,vec(Board:pos():x()+31,Board:pos():y()+6,Board:pos():z()+35))
    holoScale(4,vec(1,0.3,0.4))
    holoAng(4,ang())
    
    holoCreate(5,vec(Board:pos():x()+25,Board:pos():y()+2,Board:pos():z()+35))
    holoScale(5,vec(0.4,1,1.2))
    holoAng(5,ang())
#I    
    holoCreate(6,vec(Board:pos():x()+17,Board:pos():y()+2,Board:pos():z()+35))
    holoScale(6,vec(0.4,1,1.2))
    holoAng(6,ang())
#S    
    holoCreate(7,vec(Board:pos():x()+5,Board:pos():y()+6,Board:pos():z()+40))
    holoScale(7,vec(0.7,0.3,0.4))
    holoAng(7,ang())
    
    holoCreate(8,vec(Board:pos():x()+10,Board:pos():y()+6,Board:pos():z()+37))
    holoScale(8,vec(0.3,0.35,0.7))
    holoAng(8,ang())
    
    holoCreate(9,vec(Board:pos():x()+5,Board:pos():y()+6,Board:pos():z()+34))
    holoScale(9,vec(0.7,0.3,0.2))
    holoAng(9,ang())
    
    holoCreate(10,vec(Board:pos():x()+2,Board:pos():y()+6,Board:pos():z()+30))
    holoScale(10,vec(0.2,0.35,0.5))
    holoAng(10,ang())
    
    holoCreate(11,vec(Board:pos():x()+7,Board:pos():y()+6,Board:pos():z()+28))
    holoScale(11,vec(0.8,0.3,0.2))
    holoAng(11,ang())
#G
    holoCreate(12,vec(Board:pos():x()-20,Board:pos():y()+6,Board:pos():z()+40))
    holoScale(12,vec(1,0.3,0.4))
    holoAng(12,ang())
    
    holoCreate(13,vec(Board:pos():x()-15,Board:pos():y()+6,Board:pos():z()+32))
    holoScale(13,vec(0.3,0.35,1))
    holoAng(13,ang())
        
    holoCreate(15,vec(Board:pos():x()-20,Board:pos():y()+6,Board:pos():z()+27))
    holoScale(15,vec(1,0.3,0.3))
    holoAng(15,ang())
    
    holoCreate(16,vec(Board:pos():x()-27,Board:pos():y()+2,Board:pos():z()+30))
    holoScale(16,vec(0.2,1,0.7))
    holoAng(16,ang())
    
    holoCreate(17,vec(Board:pos():x()-27,Board:pos():y()+6,Board:pos():z()+34))
    holoScale(17,vec(0.5,0.3,0.2))
    holoAng(17,ang())
#U
    holoCreate(18,vec(Board:pos():x()-32,Board:pos():y()+2,Board:pos():z()+35))
    holoScale(18,vec(0.2,1,1.3))
    holoAng(18,ang())
    
    holoCreate(19,vec(Board:pos():x()-36,Board:pos():y()+6,Board:pos():z()+28))
    holoScale(19,vec(0.8,0.4,0.4))
    holoAng(19,ang())
    
    holoCreate(20,vec(Board:pos():x()-41,Board:pos():y()+2,Board:pos():z()+35))
    holoScale(20,vec(0.2,1,1.3))
    holoAng(20,ang())
#Y
    holoCreate(21,vec(Board:pos():x()-49,Board:pos():y()+2,Board:pos():z()+41))
    holoScale(21,vec(0.2,1,1))
    holoAng(21,ang(45,0,0))
    
    holoCreate(22,vec(Board:pos():x()-51,Board:pos():y()+2,Board:pos():z()+35))
    holoScale(22,vec(0.2,0.9,2))
    holoAng(22,ang(-30,0,0))
    
    timer("Pause",1000)
    
}
elseif(clk("Pause"))
{
#P
    holoCreate(23,vec(Board:pos():x()+45,Board:pos():y()+2,Board:pos():z()-10))
    holoScale(23,vec(0.4,1,5))
    holoColor(23,vec(255,0,0))
    holoAng(23,ang())
   
    holoCreate(24,vec(Board:pos():x()+37,Board:pos():y()+2,Board:pos():z()+10))
    holoScale(24,vec(0.4,0.9,2))
    holoColor(24,vec(255,0,0))
    holoAng(24,ang(45,0,0))
    
    holoCreate(25,vec(Board:pos():x()+37,Board:pos():y()+2,Board:pos():z()-4))
    holoScale(25,vec(0.4,0.95,2))
    holoColor(25,vec(255,0,0))
    holoAng(25,ang(-45,0,0))
#W
    holoCreate(26,vec(Board:pos():x()+28,Board:pos():y()+2,Board:pos():z()-25))
    holoScale(26,vec(0.4,1,2.5))
    holoColor(26,vec(255,0,0))
    holoAng(26,ang())
    
    holoCreate(27,vec(Board:pos():x()+22,Board:pos():y()+2,Board:pos():z()-30))
    holoScale(27,vec(0.4,0.95,2))
    holoColor(27,vec(255,0,0))
    holoAng(27,ang(-30,0,0))
    
    holoCreate(28,vec(Board:pos():x()+12,Board:pos():y()+2,Board:pos():z()-30))
    holoScale(28,vec(0.4,0.9,2))
    holoColor(28,vec(255,0,0))
    holoAng(28,ang(30,0,0))
    
    holoCreate(29,vec(Board:pos():x()+6,Board:pos():y()+2,Board:pos():z()-25))
    holoScale(29,vec(0.4,1,2.5))
    holoColor(29,vec(255,0,0))
    holoAng(29,ang())
#N
    holoCreate(30,vec(Board:pos():x()-5,Board:pos():y()+2,Board:pos():z()-25))
    holoScale(30,vec(0.4,1,2.5))
    holoColor(30,vec(255,0,0))
    holoAng(30,ang())
    
    holoCreate(31,vec(Board:pos():x()-12,Board:pos():y()+2,Board:pos():z()-25))
    holoScale(31,vec(0.4,0.9,2.4))
    holoColor(31,vec(255,0,0))
    holoAng(31,ang(30,0,0))

    holoCreate(32,vec(Board:pos():x()-20,Board:pos():y()+2,Board:pos():z()-25))
    holoScale(32,vec(0.4,1,2.5))
    holoColor(32,vec(255,0,0))
    holoAng(32,ang())

    timer("Pause2",1000)
}
elseif(clk("Pause2"))
{
    #Z
    holoCreate(33,vec(Board:pos():x()-40,Board:pos():y()+2,Board:pos():z()-10))
    holoScale(33,vec(2.5,1,0.5))
    holoColor(33,vec(255,0,0))
    holoAng(33,ang())
    
    holoCreate(34,vec(Board:pos():x()-40,Board:pos():y()+2,Board:pos():z()-23))
    holoScale(34,vec(3,0.9,0.5))
    holoColor(34,vec(255,0,0))
    holoAng(34,ang(45,0,0))
    
    holoCreate(35,vec(Board:pos():x()-40,Board:pos():y()+2,Board:pos():z()-37))
    holoScale(35,vec(2.5,1,0.5))
    holoColor(35,vec(255,0,0))
    holoAng(35,ang())
    
    holoCreate(36,vec(Board:pos():x(),Board:pos():y(),Board:pos():z()-60))
    holoScale(36,vec(2,2,2))
    holoColor(36,vec(0,255,0))
    holoModel(36,"cone")
    holoAng(36,ang(180,0,0))
    
    I = 1
    while(I < 37)
    {
    holoParent(I,0)
    I++
    }
    
    interval(20)
}
elseif(chatClk())
{
    if(lastSpoke() == owner())
    {
        if(lastSaid():trim() == "!spin")
        {
            Spin = !Spin
        }
        elseif(lastSaid():trim() == "!on")
        {
            if(On)
            {
                I = 0
                while(I<37)
                {
                    holoAlpha(I,0)
                    I++
                }
                On = 0 
            }
            else
            {
                I = 0
                while(I<37)
                {
                    holoAlpha(I,255)
                    I++
                }
                On = 1 
            }
        }
    }
}
else
{
    interval(20)
    if(Spin)
    {
        Angle += 1
        if(Angle > 360)
        {
            Angle -= 360
        }
    }
    holoAng(0,ang(0,Angle,0))
    holoPos(0,Entity:pos():setZ(Entity:pos():z() + 180 + sin(Angle) * 30))
}
