@name Let there be light
@inputs 
@outputs 
@persist Own:entity O:entity 
@trigger 
runOnTick(1)
if(first()|duped()){
    Own=entity():owner()
    O=entity():owner()
}
if(O:weapon():type()=="weapon_physgun"&O:keyAttack2()){
    if(O:aimEntity():isPlayer()){
        Own=O:aimEntity()
        if(changed(Own:id())){print("Now following: "+Own:name())}
    }
    if(O:keyUse()&!O:aimEntity()){
        Own=O
        if(changed(Own:id())){print("Returning to you!")}
    }
}
if(!O|!Own){selfDestructAll()}

entity():setAlpha(0)
runOnChat(1)
K=chatClk()
Chat=Own:lastSaid()

E=entity():isConstrainedTo()

Color="!c" 
Break=" "
Color1=Chat:find(Color)
Break1=Chat:find(Break)
if(Color1&Break&K){
    X=Chat:explode(Break)[2,string]:toNumber()
    Y=Chat:explode(Break)[3,string]:toNumber()
    Z=Chat:explode(Break)[4,string]:toNumber()
    Color2=vec(X,Y,Z)
E:setColor(Color2)
}

E:setAlpha(0)
Stand=vec(0,0,85)
Crouch=vec(0,0,5)
if(!Own:isCrouch()){XYZ=Own:pos()+Stand}else{XYZ=Own:aimPos()+Crouch}
E:applyForce((20*((XYZ-E:pos())+vec(0,0,0))-E:vel())*E:mass()+Own:vel()*10)


#############Below here is some code to assimilate########

#if(chatClk(O) & LS == "/boom") {selfDestructAll()}
#if(chatClk(O) & LS == "/default") {EE:setColor(255,255,255,255)  EE:setMaterial("Models/hunter/myplastic") }
#if(chatClk(O) & LS == "/black") {EE:setColor(0,0,0,255)}
#if(chatClk(O) & LS == "/red") {EE:setColor(255,0,0,255)}
#if(chatClk(O) & LS == "/green") {EE:setColor(0,255,0,255)}
#if(chatClk(O) & LS == "/blue") {EE:setColor(0,0,255,255)}
#if(chatClk(O) & LS == "/white") {EE:setColor(255,255,255,255)}
#if(chatClk(O) & LS == "/gone") {EE:setColor(0,0,0,0)}
#if(chatClk(O) & LS == "/yellow") {EE:setColor(255,255,0,255)}
#if(chatClk(O) & LS == "/aqua") {EE:setColor(0,255,255,255)}
#if(chatClk(O) & LS == "/purple") {EE:setColor(255,0,255,255)}
