@name Holo test
@inputs 
@outputs
@persist Timer Model Scale FollowT:entity Follow
interval(20)
runOnChat(1)

if (first()){    
    holoCreate(1)
    holoCreate(2)
    holoCreate(3)
    holoCreate(4)
    holoCreate(5)
    holoCreate(6)
    holoCreate(7)
    holoCreate(8)
    holoCreate(9)
    holoCreate(10)
    holoCreate(11)
    
    holoModel(1,"sphere")
    holoModel(2,"sphere")
    holoModel(3,"sphere")
    holoModel(4,"sphere")
    holoModel(5,"sphere")
    holoModel(6,"sphere")
    holoModel(7,"sphere")
    holoModel(8,"sphere")
    holoModel(9,"sphere")
    holoModel(10,"sphere")
    holoModel(11,"sphere")
    
    holoParent(1,entity())
    holoParent(2,entity())
    holoParent(3,entity())
    holoParent(4,entity())
    holoParent(5,entity())
    holoParent(6,entity())
    holoParent(7,entity())
    holoParent(8,entity())
    holoParent(9,entity())
    holoParent(10,entity())
    holoParent(11,entity())
    
    holoColor(1,vec(255,255,255), 255)
    holoColor(2,vec(0,0,0), 255)
    holoColor(3,vec(255,255,255), 255)
    holoColor(4,vec(0,0,0), 255)
    holoColor(5,vec(255,255,255), 255)
    holoColor(6,vec(0,0,0), 255)
    holoColor(7,vec(255,255,255), 255)
    holoColor(8,vec(0,0,0), 255)
    holoColor(9,vec(255,255,255), 255)
    holoColor(10,vec(0,0,0), 255)
    holoColor(11,vec(0,0,0), 255)
    
    holoScale(11,vec(0,0,0))
    holoPos(11,entity():pos())
    Model = 1
}

Timer += 0.02
if (Model){
    Scale += 0.01
    if (Scale >= 1.5){Model = 0}
}else{
    Scale -= 0.01
    if (Scale <= 0.2){Model = 1}
}

holoScale(1,vec(Scale,Scale,Scale))
holoScale(2,vec(Scale,Scale,Scale))
holoScale(3,vec(Scale,Scale,Scale))
holoScale(4,vec(Scale,Scale,Scale))
holoScale(5,vec(Scale,Scale,Scale))
holoScale(6,vec(Scale,Scale,Scale))
holoScale(7,vec(Scale,Scale,Scale))
holoScale(8,vec(Scale,Scale,Scale))
holoScale(9,vec(Scale,Scale,Scale))
holoScale(10,vec(Scale,Scale,Scale))

Add = 360/10
Y = owner():pos() + vec(0,cos(Timer*180 + Add)*50,0)
X = owner():pos() + vec(sin(Timer*180 + Add)*50,0,0)
Z = owner():pos():z() + owner():height() + 20
holoPos(1, vec(X:x(),Y:y(),Z))

Add += 360/10
Y = owner():pos() + vec(0,cos(Timer*180 + Add)*50,0)
X = owner():pos() + vec(sin(Timer*180 + Add)*50,0,0)
holoPos(2, vec(X:x(),Y:y(),Z))

Add += 360/10
Y = owner():pos() + vec(0,cos(Timer*180 + Add)*50,0)
X = owner():pos() + vec(sin(Timer*180 + Add)*50,0,0)
holoPos(3, vec(X:x(),Y:y(),Z))

Add += 360/10
Y = owner():pos() + vec(0,cos(Timer*180 + Add)*50,0)
X = owner():pos() + vec(sin(Timer*180 + Add)*50,0,0)
holoPos(4, vec(X:x(),Y:y(),Z))

Add += 360/10
Y = owner():pos() + vec(0,cos(Timer*180 + Add)*50,0)
X = owner():pos() + vec(sin(Timer*180 + Add)*50,0,0)
holoPos(5, vec(X:x(),Y:y(),Z))

Add += 360/10
Y = owner():pos() + vec(0,cos(Timer*180 + Add)*50,0)
X = owner():pos() + vec(sin(Timer*180 + Add)*50,0,0)
holoPos(6, vec(X:x(),Y:y(),Z))

Add += 360/10
Y = owner():pos() + vec(0,cos(Timer*180 + Add)*50,0)
X = owner():pos() + vec(sin(Timer*180 + Add)*50,0,0)
holoPos(7, vec(X:x(),Y:y(),Z))

Add += 360/10
Y = owner():pos() + vec(0,cos(Timer*180 + Add)*50,0)
X = owner():pos() + vec(sin(Timer*180 + Add)*50,0,0)
holoPos(8, vec(X:x(),Y:y(),Z))

Add += 360/10
Y = owner():pos() + vec(0,cos(Timer*180 + Add)*50,0)
X = owner():pos() + vec(sin(Timer*180 + Add)*50,0,0)
holoPos(9, vec(X:x(),Y:y(),Z))

Add += 360/10
Y = owner():pos() + vec(0,cos(Timer*180 + Add)*50,0)
X = owner():pos() + vec(sin(Timer*180 + Add)*50,0,0)
holoPos(10, vec(X:x(),Y:y(),Z))

if(chatClk(owner()) & owner():lastSaid():left(7) == "#follow") {
    if(owner():lastSaid() == "#follow") {
        findIncludeClass("player")
        findExcludePlayer(owner())
        Fsphere = findInSphere(owner():aimPos(), 50000)
        if(Fsphere > 0) {
            FollowT = findClosest(owner():aimPos())
            Follow = 1
        }
    }
}
if (Follow){
    Y = FollowT:pos() + vec(0,cos(Timer*180 + Add)*50,0)
    X = FollowT:pos() + vec(sin(Timer*180 + Add)*50,0,0)
    Z = FollowT:pos():z() + FollowT:height() + 30
    holoScale(11,vec(3,3,3))
    holoPos(11, vec(X:x(),Y:y(),Z))
}else{holoPos(11,entity():pos())}
