@name DecoyPlayer
@inputs 
@outputs 
@persist Weapon:string GModel:string GPos:vector
@trigger 

runOnTick(1)
if(first()){
O=owner()
Walk=owner():keyWalk()
Use=1
Model=owner():model()
#if(owner():weapon():type()=="weapon_melee"){Anim="ACT_IDLE_RELAXED"}
}
if (owner():weapon():type()=="weapon_smg1"){Anim="ACT_IDLE_ANGRY_SMG1",Spawnwep=1,GModel="models/weapons/w_smg1.mdl",GPos=vec(21,-5.5,51.5),GAng=owner():angles()}
if (owner():weapon():type()=="weapon_crowbar"){Anim="ACT_IDLE_ANGRY_CROWBAR",Spawnwep=1,GModel="",GPos=vec(21,-5.5,51.5),GAng=owner():angles()}
if (owner():weapon():type()=="weapon_smg1"){Anim="ACT_IDLE_ANGRY_SMG1",Spawnwep=1,GModel="models/weapons/w_smg1.mdl",GPos=vec(21,-5.5,51.5),GAng=owner():angles()}
if (owner():weapon():type()=="weapon_rpg"){Anim="ACT_IDLE_ANGRY_RPG",Spawnwep=1,GModel="models/weapons/w_rocket_launcher.mdl",GPos=vec(24,-9.5,57.5),GAng=owner():angles()+ang(0,180,0)}
if (owner():weapon():type()=="weapon_physgun"){Anim="ACT_IDLE_ANGRY_SMG1",Spawnwep=1,GModel="models/weapons/w_physics.mdl",GPos=vec(14,-5.5,50.5),GAng=owner():angles()}
if (owner():weapon():type()=="weapon_physcannon"){Anim="ACT_IDLE_ANGRY_SMG1",Spawnwep=1,GModel="models/weapons/w_physics.mdl",GPos=vec(14,-5.5,50.5),GAng=owner():angles()}
if (owner():weapon():type()=="weapon_pistol"){Anim="ACT_RANGE_ATTACK_PISTOL",Spawnwep=1,GModel="models/weapons/w_pistol.mdl",GPos=vec(22,-7.5,55.5),GAng=owner():angles()+ang(0,180,0)}
if (owner():weapon():type()=="weapon_357"){Anim="ACT_RANGE_ATTACK_PISTOL",Spawnwep=1,GModel="models/weapons/w_357.mdl",GPos=vec(18,-7.5,55.5),GAng=owner():angles()}
if (owner():weapon():type()=="gmod_tool"){Anim="ACT_RANGE_ATTACK_PISTOL",Spawnwep=1,GModel="models/weapons/w_toolgun.mdl",GPos=vec(17,-7.5,55.5),GAng=owner():angles()}
if (owner():weapon():type()=="weapon_shotgun"){Anim="ACT_RANGE_ATTACK_SHOTGUN",Spawnwep=1,GModel="models/weapons/w_shotgun.mdl",GPos=vec(24,-4.5,50.5),GAng=owner():angles()+ang(0,180,0)}
if (owner():weapon():type()=="weapon_ar2"){Anim="ACT_IDLE_ANGRY_AR2",Spawnwep=1,GModel="models/weapons/w_irifle.mdl",GPos=vec(24,-5.5,49.5),GAng=owner():angles()+ang(0,180,0)}
if (owner():weapon():type()=="weapon_crossbow"){Anim="ACT_RANGE_ATTACK_SHOTGUN",Spawnwep=1,GModel="models/weapons/w_crossbow.mdl",GPos=vec(11,-7.5,50.5),GAng=owner():angles()}
if(!Spawnwep){Anim="ACT_IDLE"}



if(changed(owner():keyWalk())&owner():keyWalk()){holoCreate(1)
holoModel(1,"models/Humans/Group01/male_07.mdl")#replace with your player model.
holoAnim(1,Anim)
#[P=propSpawn("models/props_c17/lampShade001a.mdl",owner():pos(),1)
P:propNotSolid(1)
P:setAlpha(0)
]#holoAlpha(1,255)
timer("delete",20)
holoPos(1,owner():pos())
holoAng(1,owner():angles())
holoColor(1,vec(255,255,255))

if(Spawnwep){holoCreate(2)
holoModel(2,GModel)
#holoAnim(2,"ACT_WM_IDLE")
holoParent(2,1)
#[P=propSpawn("models/props_c17/lampShade001a.mdl",owner():pos(),1)
P:propNotSolid(1)
P:setAlpha(0)
]#holoAlpha(2,255)
holoPos(2,owner():toWorld(GPos))
holoAng(2,GAng)
holoColor(2,vec(255,255,255))
}

timer("active",10000)
timer("wearoff",8000)
owner():setMaterial("models/effects/vol_light001")
owner():weapon():setMaterial("models/effects/vol_light001")
owner():setAlpha(0)
owner():weapon():setAlpha(0)
Use=0
    }
if(clk("wearoff")){holoAlpha(1,120),holoAlpha(2,120),owner():setMaterial("models/props_combine/stasisshield_sheet"),holoMaterial(1,""),owner():weapon():setMaterial("models/props_combine/stasisshield_sheet"),owner():setAlpha(255),owner():weapon():setAlpha(255),owner():soundPlay(1,100,"ambient/energy/zap7.wav")}
if(clk("active")){holoDelete(1),holoDelete(2),Use=1,owner():setMaterial(""),owner():weapon():setMaterial(""),owner():soundPlay(1,100,"buttons/button18.wav")}

