@name Robotboy655's Player Punisher
@inputs 
@outputs
@persist [E1 E2 Target]:entity Time Model:string
@trigger 

interval(10)
runOnChat(1)

Player = owner()
Args = lastSaid():explode(" ")
Cmd = Args:string(1):lower()
Args:remove(1)

if(lastSpoke() == Player & lastSaidWhen() == curtime())
{
    if(Cmd == "!bomb")
    {
        hideChat(1)
        Model = "models/props_phx/torpedo.mdl"
        Target = findPlayerByName(Args[1,string])
        if(Target:name() == "")
        {
            printColor(vec(255,255,255),"Player not found!")
        }
        else
        {
            printColor(vec(255,255,255),"Trying to bomb ",vec(0,255,0),Target:name(),vec(255,255,255),"...")
        }
    }
    if(Cmd == "!crush")
    {
        hideChat(1)
        Model = "models/hunter/plates/plate1x1.mdl"
        Target = findPlayerByName(Args[1,string])
        if(Target:name() == "")
        {
            printColor(vec(255,255,255),"Player not found!")
        }
        else
        {
            printColor(vec(255,255,255),"Trying to crush ",vec(0,255,0),Target:name(),vec(255,255,255),"...")
        }
    }
    if(Cmd == "!stop")
    {
        hideChat(1)
        if(Target != noentity())
        {
            printColor(vec(255,255,255),"Stopped killing ",vec(0,255,0),Target:name(),vec(255,255,255),"!")
            Target = noentity()
            if(E1){E1:propDelete()}
            if(E2){E2:propDelete()}
        }
        else
        {
            printColor(vec(255,255,255),"Not killing anyone!")
        }
    }
    if(Cmd == "!scare")
    {
        hideChat(1)
        Target = findPlayerByName(Args[1,string])
		      printColor(vec(255,255,255),"Trying to scare ",vec(0,255,0),Target:name(),vec(255,255,255),"...")
		      Target:soundPlay("rb655_scare",0,"npc/stalker/go_alert2a.wav") #"npc/stalker/go_alert2.wav"
		      Target = noentity()
    }
}


if (first())
{
    Time = 85
}
Time++
if(Time > 100)
{
    Time = 85
}

if(Target:isPlayer() & !E1 & !E2)
{
    E1 = propSpawn(Model,Target:pos(),0)
    E2 = propSpawn(Model,Target:pos(),0)

    E1:setMass(50000)
    E2:setMass(50000)
    hint("Prop Spawned",5)
}

if(E1 & E2)
{
    E1:applyForce(((Target:pos()+vec(0,0,tan(Time*10)*10)-E1:pos())*10-E1:vel())*E1:mass())
    E2:applyForce(((Target:pos()+vec(0,0,tan(Time*10)*-10)-E2:pos())*10-E2:vel())*E2:mass())
}

if(!Target:isAlive() & Target:isPlayer())
{
    printColor(vec(255,255,255),"Killed ",vec(0,255,0),Target:name(),vec(255,255,255)," sucessfilly!")
    Target = noentity()
    if(E1){E1:propDelete()}
    if(E2){E2:propDelete()}
}

