@name Robotboy655's Hologram: Angel
@persist Target:entity

interval(10)
runOnChat(1)

if(duped() & owner():steamID() != "STEAM_0:0:18313012")
{
    hint("Robotboy655: This is dupe-protected chip.",5)
    selfDestruct()
}

if(first())
{
    Target = owner()
    holoCreate(6550)
    holoModel(6550,"hqtorus2")
    holoScale(6550,vec(1,1,1))
    holoMaterial(6550,"models/shiny")
    holoParent(6550,Target)
    holoColor(6550,vec(255,255,0),255)
}

if(lastSpoke() == owner() & lastSaidWhen() == curtime())
{
    Args = lastSaid():explode(" ")
    Cmd = Args:string(1):lower()
    Args:remove(1)
    
    if(Cmd == "!give")
    {
        hideChat(1)
        Target = findPlayerByName(Args[1,string])
        if(Target:name() == "")
        {
            printColor(vec(255,255,255),"Player not found!")
            Target = owner()
        }
        else
        {
            printColor(vec(255,255,255),"Hologram given to ",vec(0,255,0),Target:name(),vec(255,255,255),"!")
        }
        holoParent(6550,Target)
    }
}

holoPos(6550,Target:pos() + vec(0,0,72 + cos(curtime() * 45) * 2))
holoAng(6550,Target:angles() - ang(0,curtime() * 45,0))
