@name Robotboy655's Holo-Man
@inputs P:wirelink C:wirelink
@outputs 
@persist Pos:vector Ang:angle
@trigger 

interval(10)

Man = holoEntity(2000)
Ang = ang(0,owner():eye():y()*180,0)

if(first() | duped())
{
    holoCreate(2000)
    holoModel(2000,"hqcylinder")
    holoScaleUnits(2000,vec(2,2,4))
    holoAng(2000,ang(0,90,0))
    holoPos(2000,entity():pos() + vec(10,0,0))
    
    holoCreate(2001)
    holoModel(2001,"hqsphere")
    holoScaleUnits(2001,vec(2,2,2))
    holoAng(2001,ang(0,0,0))
    holoPos(2001,entity():pos() + vec(10,0,2.5))
    
    Pos = entity():pos()
    Ang = ang(0,0,0)
}

holoPos(2000,Pos)
holoAng(2000,Ang)

holoPos(2001,Pos + vec(0,0,2.5))
holoAng(2001,Ang)

if(P["W",number])
{
    Pos = Pos - owner():eye():setZ(0)
}
if(P["S",number])
{
    Pos = Pos + owner():eye():setZ(0)
}
if(P["A",number])
{
    Pos = Pos - Man:right()
}
if(P["D",number])
{
    Pos = Pos + Man:right()
}

C["Activated",number] = P["Active",number]
C["Direction",vector] = -owner():eye()
C["Position",vector] = Man:pos() + 50*owner():eye()
C["Parent",entity] = Man
