@name Arrow For Objectives(Work in Progress)
@inputs 
@outputs 
@persist Timer Red:vector Blue:vector Green:vector Yellow:vector Orange:vector Teal:vector White:vector Black:vector Grey:vector Pink:vector
@persist Scale Speed Offset
@trigger 

function void printCommands(){
    entity():setAlpha(0)
    print("Jim Dangles Arrow")
    print("COMANDS")
    print("| This Chip is controlled by chat commands")
    print("| /scale, /speed, /offset, and /color, /remove     ")
    print("| Scale sets how high the arrow bounces, this value needs to be a number  ")
    print("| Speed adjustst the arrows bounce speed, this value needs to be a number ")
    print("| Offset changes how high the arrow is, this value needs to be a number  ")
    print("| color has many inputs, Red, Blue, Green, Yellow, Orange, Teal, White, Black, Grey, and Pink. these values need to be in string form")
    
    }


if(first() | duped()){
    printCommands()
    Red = vec(255,0,0)
    Blue = vec(0,0,255)
    Green = vec(0,255,0)
    Yellow = vec(255,230,0)
    Orange = vec(255,120,0)
    Teal = vec(0,120,255)
    White = vec(255,255,255)
    Black = vec(0,0,0)
    Grey = vec(100,100,100)
    Pink = vec(250,0,120)
    
    Scale = 10
    Speed = 9
    Offset = 30
    }



runOnTick(10)
runOnChat(1)


Timer=Timer+1*Speed
T=Timer
Pos = vec(0,0,Offset+cos(T)*Scale)
if(first()){
holoCreate(1)
holoModel(1, "hq_cone")
holoAng(1, ang(180,0,0))
holoScale(1, vec(3,3,3))
holoCreate(2)
holoModel(2, "hq_cylinder")
holoScale(2,vec(1,1, 6))
holoAng(2, ang(0,0,0))
}
holoPos(1, entity():isWeldedTo():pos()+Pos)
holoPos(2, entity():isWeldedTo():pos()+Pos+vec(0,0,50))



if(chatClk(owner())){
    Chat = owner():lastSaid():explode(" ")
    if(Chat:string(1)=="/color"){
        if(Chat:string(2)==""){print("Colors are, red, green, blue, yellow, orange, teal, white, black grey, and pink")}
        hideChat(1)
        if(Chat:string(2):upper()=="RED"){holoColor(1, Red) holoColor(2, Red)}
        if(Chat:string(2):upper()=="BLUE"){holoColor(1, Blue) holoColor(2, Blue)}
        if(Chat:string(2):upper()=="GREEN"){holoColor(1, Green) holoColor(2, Green)}
        if(Chat:string(2):upper()=="YELLOW"){holoColor(1, Yellow) holoColor(2, Yellow)}
        if(Chat:string(2):upper()=="ORANGE"){holoColor(1, Orange) holoColor(2, Orange)}
        if(Chat:string(2):upper()=="TEAL"){holoColor(1, Teal) holoColor(2, Teal)}
        if(Chat:string(2):upper()=="WHITE"){holoColor(1, White) holoColor(2, White)}
        if(Chat:string(2):upper()=="BLACK"){holoColor(1, Black) holoColor(2, Black)}
        if(Chat:string(2):upper()=="GREY"){holoColor(1, Grey) holoColor(2, Grey)}
        if(Chat:string(2):upper()=="PINK"){holoColor(1, Pink) holoColor(2, Pink)}
        }
    if(Chat:string(1)=="/scale"){
        hideChat(1)
        if(Chat:string(2):toNumber()!=0){
            Scale = Chat:string(2):toNumber()
            }
        }
    if(Chat:string(1)=="/speed"){
        hideChat(1)
        if(Chat:string(2):toNumber()!=0){
            Speed = Chat:string(2):toNumber()
            }
        }
    if(Chat:string(1)=="/offset"){
        hideChat(1)
        Offset = Chat:string(2):toNumber()
        } 
    }
    
      if(Chat:string(1)=="/remove"){
        hideChat(1)
        selfDestruct()
        } 
    

