@name Ultra Bird
@inputs 
@outputs PP:vector P:vector PP2:vector P2:vector PP3:vector P3:vector Target:entity 
@outputs T Ar:array T2 T3 T4 WSpeed Speed Go Follow SPos:vector
interval(10)
runOnChat(1)
if (duped()) {reset()}
if (first()) {
    Speed=1,WSpeed=1,Go=1
    print(4,"Commands Have Been Printed Into Console")
    print(1," ")
    print(1," ")
    print(1,"       --- Ultra Bird ---")
    print(1," ")
    print(1,"       Made By Perli55")
    print(1,"       Chat Commands:")
    print(1,"       /speed <Number Here> - Sets The Bird's Speed, Default Is 1")
    print(1,"       /wing <Number Here> - Sets The Speed Of The Birds Wings, Default Is 1")
    print(1,"       /target <Player Name Here> - Makes The Bird Fly To That Player")
    print(1,"       /follow <Player Name Here> - Makes The Bird Fly To That Player And Follow Him")
    print(1,"       /unfollow - Makes The Bird Not Follow Anyone Anymore")
    print(1,"       /freeze - Freezes The Bird")
    print(1,"       /unfreeze - Unfreezes The Bird")
    print(1,"       /reset - Resets The Bird")
    print(1,"       /remove - Removes The Bird")
    print(1," ")
    print(1," ")
    holoCreate(1,entity():pos()+vec(0,0,250),vec(5,1,1),ang(),
    vec(20,20,150),"hqsphere")
    holoCreate(2,entity():pos()+vec(8.5,-21,250),vec(0.8,3.6,0.15),ang(),
    vec(0,200,200))
    holoCreate(3,entity():pos()+vec(8.5,21,250),vec(0.8,3.6,0.15),ang(),
    vec(0,200,200))
    holoCreate(4,entity():pos()+vec(-2,-37.5,250),vec(0.1,0.8,1),ang(90,180,0),
    vec(0,150,200),"pyramid")
    holoCreate(5,entity():pos()+vec(-2,37.5,250),vec(0.1,0.8,1),ang(90,180,0),
    vec(0,150,200),"pyramid")
    holoCreate(6,entity():pos()+vec(30,0,249),vec(0.45,0.45,1.3),ang(90,0,0),
    vec(200,200,0),"cone")
    holoCreate(7,entity():pos()+vec(25,2,251.5),vec(0.2,0.2,0.2),ang(),
    vec(255,255,255),"hqsphere")
    holoCreate(8,entity():pos()+vec(25,-2,251.5),vec(0.2,0.2,0.2),ang(),
    vec(255,255,255),"hqsphere")
    holoCreate(9,entity():pos()+vec(26,2,251.5),vec(0.08,0.08,0.08),ang(),
    vec(0,0,0),"sphere")
    holoCreate(10,entity():pos()+vec(26,-2,251.5),vec(0.08,0.08,0.08),ang(),
    vec(0,0,0),"sphere")
    holoCreate(11,entity():pos()+vec(2,9.7,250),vec(1.84,0.08,2.6),ang(0,0,90),
    vec(0,225,225),"prism")
    holoCreate(12,entity():pos()+vec(2,-9.7,250),vec(1.84,0.08,2.6),ang(0,0,270),
    vec(0,225,225),"prism")
    holoCreate(13,entity():pos()+vec(0,0,250))
    holoCreate(14,entity():pos()+vec(8.5,-21,250))
    holoCreate(15,entity():pos()+vec(8.5,21,250))
    holoAlpha(13,0)
    holoAlpha(14,0)
    holoAlpha(15,0)
    holoParent(4,2)
    holoParent(5,3)
    holoParent(6,1)
    holoParent(7,1)
    holoParent(8,1)
    holoParent(9,1)
    holoParent(10,1)
    holoParent(11,3)
    holoParent(12,2)
    holoParent(14,1)
    holoParent(15,1)
    findByClass("player")
    Ar=findToArray()
    T2=round(random(0.5,Ar:count()+0.49))
    holoEntity(4):setTrails(32,0,1,"trails/laser",vec(0,225,225),255)
    holoEntity(5):setTrails(32,0,1,"trails/laser",vec(0,225,225),255)
    }
if (Follow) {T4++} else {T4=0}
if (Follow&abs((Target:pos()-holoEntity(1):pos()):length())<310) 
    {SPos=vec(sin(T4*5)*150,cos(T4*5)*150,0)} else {Spos=vec()}
if (Target==noentity()) {T2++,Target=Ar:entity(T2)}
if (T2>Ar:count()) {T2=1}
if (!Follow&abs((Target:pos()-holoEntity(1):pos()):length())<310) {T2++,T3=0,Target=Ar:entity(T2)}
if (T3>1500) {T2++,T3=0,Target=Ar:entity(T2)}
T+=WSpeed*Go
if (!Follow) {T3++}
if (Go) {holoAng(1,-holoEntity(13):heading(Target:pos()+vec(0,0,250)+SPos))}
holoAng(2,ang(0,0,sin(T*5)*37)+holoEntity(1):angles())
holoAng(3,ang(0,0,-sin(T*5)*37)+holoEntity(1):angles())
holoPos(1,entity():pos()+vec(0,0,250)+P)
holoPos(2,holoEntity(14):pos()+vec(0,0,-sin(T*5)*15))
holoPos(3,holoEntity(15):pos()+vec(0,0,-sin(T*5)*15))
PP = ((Target:pos()+vec(0,0,250)-holoEntity(1):pos()+SPos):normalized()*(Speed*6)*Go)
P+=PP
PP2 = ((Target:pos()+vec(8.5,-21,250)-holoEntity(2):pos()+SPos):normalized()*(Speed*6)*Go)
P2+=PP2
PP3 = ((Target:pos()+vec(8.5,21,250)-holoEntity(3):pos()+SPos):normalized()*(Speed*6)*Go)
P3+=PP3
holoPos(13,entity():pos()+vec(0,0,250)+P)
if (chatClk(owner()) & owner():lastSaid():explode(" "):string(1):lower()=="/speed") {
    Speed=owner():lastSaid():explode(" "):string(2):toNumber()} 
if (chatClk(owner()) & owner():lastSaid():explode(" "):string(1):lower()=="/wing") {
    WSpeed=owner():lastSaid():explode(" "):string(2):toNumber()}
if (chatClk(owner()) & owner():lastSaid():explode(" "):string(1):lower()=="/target") {
    Target=findPlayerByName(owner():lastSaid():sub(9):lower())}
if (chatClk(owner()) & owner():lastSaid():explode(" "):string(1):lower()=="/follow") {
    Follow=1,Target=findPlayerByName(owner():lastSaid():sub(9):lower())}
if (chatClk(owner()) & owner():lastSaid():explode(" "):string(1):lower()=="/unfollow") {
    Follow=0,Target=Ar:entity(T2)}
if (chatClk(owner()) & owner():lastSaid():explode(" "):string(1):lower()=="/freeze") {
    Go=0}
if (chatClk(owner()) & owner():lastSaid():explode(" "):string(1):lower()=="/unfreeze") {
    Go=1}
if (chatClk(owner()) & owner():lastSaid():explode(" "):string(1):lower()=="/reset") {
    hint("Resetting...",7),reset()} 
if (chatClk(owner()) & owner():lastSaid():explode(" "):string(1):lower()=="/remove") {
    hint("You Removed Me?",7),selfDestruct()}
