@name MAGIC
@persist Magic N P:vector
if(first())
{
    runOnTick(1)
    runOnChat(1)
    function magic(E:entity)
    {
        holoCreate(1)
        holoModel(1,"models/props_halloween/halloween_gift.mdl")
        holoPos(1,E:pos()+vec(cos(E:eyeAngles():yaw())*100,sin(E:eyeAngles():yaw())*100,40))
        holoScale(1,vec(0.5))
        holoEntity(1):soundPlay("magic",3,"vo/halloween_merasmus/sf12_found04.wav")
        soundVolume("magic",5)
        Magic = 1
        timer("stahp",5000)
        P = E:pos()+vec(cos(E:eyeAngles():yaw())*50,sin(E:eyeAngles():yaw())*50,40)
    }
}

if(chatClk(owner()))
{
    Str = owner():lastSaid():lower():explode(" ")
    if(Str[1,string]=="/m")
    {
        hideChat(1)
        TE = findPlayerByName(Str[2,string])
        if(TE:isValid())
        {
            magic(TE)
        }else
        {
            hint("Not valid player, prick.",3)
        }
    }
}

if(Magic)
{
    holoAng(1,holoEntity(1):toWorld(ang(0,2,0)))
    N+=3
    holoPos(1,P+vec(0,0,cos(N)*5))
}

if(clk("stahp"))
{
    stoptimer("stahp")
    Magic = 0
    holoDelete(1)
}
