@name Securitron Stand
@inputs Gun:entity
@outputs Fire
@persist 
@trigger 
interval(100)

findByClass("player")
#findExcludePlayer("strder")
T=findClosest(entity():pos())
Y=entity():bearing(T:pos())
if((T:weapon():type()=="weapon_physgun"|T:weapon():type()=="gmod_tool"|T:weapon():type()==""|T:weapon():type()=="gmod_camera")|!T:isAlive()){Aim=0}
else{Aim=1}
if(Gun:model()!=""&Aim==1){Fire=1,entity():setAng((T:pos() - entity():pos()):toAngle()),holoAng(22,(holoEntity(22):pos() - T:shootPos()):toAngle()+ang(-25,0,0))}


if(first()){holoCreate(1),holoPos(1,entity():pos()+vec(0,0,20)),holoScale(1,vec(1.4)),holoModel(1,"models/props_vehicles/carparts_wheel01a.mdl")
holoCreate(2),holoPos(2,entity():pos()+vec(0,6.5,20)),holoScale(2,vec(0.14,0.14,0.6)),holoAng(2,entity():angles()+ang(90,90,0)),holoModel(2,"models/props_phx/construct/metal_angle360.mdl")
holoCreate(3),holoPos(3,entity():pos()+vec(0,-8.5,20)),holoScale(3,vec(0.14,0.14,0.6)),holoAng(3,entity():angles()+ang(90,90,0)),holoModel(3,"models/props_phx/construct/metal_angle360.mdl")
holoCreate(4),holoPos(4,entity():pos()+vec(0,6.5,35)),holoAng(4,entity():angles()+ang(0,0,90)),holoScale(4,vec(0.25,0.2,0.2)),holoModel(4,"models/hunter/plates/plate1x3.mdl")
holoCreate(5),holoPos(5,entity():pos()+vec(0,-7,35)),holoAng(5,entity():angles()+ang(0,0,90)),holoScale(5,vec(0.25,0.2,0.2)),holoModel(5,"models/hunter/plates/plate1x3.mdl")
holoCreate(6),holoPos(6,entity():pos()+vec(0,-0.15,50)),holoAng(6,entity():angles()+ang(0,0,0)),holoScale(6,vec(0.25,0.1,0.6)),holoModel(6,"models/hunter/plates/plate1x3.mdl")
holoCreate(7),holoPos(7,entity():pos()+vec(0,0,55)),holoScale(7,vec(0.4,0.7,0.4)),holoModel(7,"models/props_vehicles/carparts_wheel01a.mdl")
holoCreate(8),holoPos(8,entity():pos()+vec(0,0,66.4)),holoScale(8,vec(0.6,0.6,4.7)),holoModel(8,"models/props_phx/construct/metal_angle360.mdl"),holoMaterial(8,"models/props_combine/metal_combinebridge001")
holoCreate(9),holoPos(9,entity():pos()+vec(0,0,59)),holoScale(9,vec(0.5,0.5,3)),holoModel(9,"models/props_phx/construct/metal_angle360.mdl"),holoMaterial(9,"models/props_canal/metalwall005b")
holoCreate(10),holoPos(10,entity():pos()+vec(0,0,110)),holoScale(10,vec(1.6,1.6,1.6)),holoModel(10,"models/hunter/blocks/cube075x075x075.mdl"),holoMaterial(10,"models/props_combine/metal_combinebridge001")
holoCreate(11),holoPos(11,entity():pos()+vec(22,0,100)),holoAng(11,entity():angles()+ang(15,0,0)),holoScale(11,vec(2,2.6,2)),holoModel(11,"models/props_lab/monitor01b.mdl")
holoCreate(12),holoPos(12,entity():pos()+vec(0,47,125)),holoScale(12,vec(1.2,1.2,1.2)),holoModel(12,"models/hunter/blocks/cube075x075x075.mdl"),holoMaterial(12,"models/props_combine/metal_combinebridge001")
holoCreate(13),holoPos(13,entity():pos()+vec(0,-47,125)),holoScale(13,vec(1.2,1.2,1.2)),holoModel(13,"models/hunter/blocks/cube075x075x075.mdl"),holoMaterial(13,"models/props_combine/metal_combinebridge001")
holoCreate(14),holoPos(14,entity():pos()+vec(29,12,125)),holoAng(14,entity():angles()+ang(90,0,0)),holoScale(14,vec(1.2,1.2,1.2)),holoModel(14,"models/cheeze/wires/speaker.mdl"),holoMaterial(14,"models/props_lab/door_klab01")
holoCreate(15),holoPos(15,entity():pos()+vec(28,-12,125)),holoAng(15,entity():angles()+ang(90,0,0)),holoScale(15,vec(1.2,1.2,1.2)),holoModel(15,"models/jaanus/wiretool/wiretool_controlchip.mdl"),holoMaterial(15,"models/props_lab/door_klab01")
holoCreate(16),holoPos(16,entity():pos()+vec(0,-50,80)),holoAng(16,entity():angles()+ang(90,0,0)),holoScale(16,vec(1,1,1)),holoModel(16,"models/Mechanics/roboticslarge/a2.mdl"),holoMaterial(16,"models/props_lab/door_klab01")
holoCreate(17),holoPos(17,entity():pos()+vec(0,50,80)),holoAng(17,entity():angles()+ang(90,0,0)),holoScale(17,vec(1,1,1)),holoModel(17,"models/Mechanics/roboticslarge/a1.mdl"),holoMaterial(17,"models/props_lab/door_klab01")
holoCreate(18),holoPos(18,entity():pos()+vec(0,-36,25)),holoAng(18,entity():angles()+ang(0,0,-75)),holoScale(18,vec(0.15,0.2,0.2)),holoModel(18,"models/hunter/plates/plate1x2.mdl"),holoMaterial(18,"models/props_lab/door_klab01")
holoCreate(19),holoPos(19,entity():pos()+vec(0,-40.5,9.5)),holoAng(19,entity():angles()+ang(0,0,-135)),holoScale(19,vec(0.15,0.2,0.2)),holoModel(19,"models/hunter/plates/plate1x2.mdl"),holoMaterial(19,"models/props_lab/door_klab01")
holoCreate(20),holoPos(20,entity():pos()+vec(0,-64.5,25)),holoAng(20,entity():angles()+ang(0,0,-105)),holoScale(20,vec(0.15,0.2,0.2)),holoModel(20,"models/hunter/plates/plate1x2.mdl"),holoMaterial(20,"models/props_lab/door_klab01")
holoCreate(21),holoPos(21,entity():pos()+vec(0,-60.5,9.5)),holoAng(21,entity():angles()+ang(0,0,-45)),holoScale(21,vec(0.15,0.2,0.2)),holoModel(21,"models/hunter/plates/plate1x2.mdl"),holoMaterial(21,"models/props_lab/door_klab01")
holoCreate(22),holoPos(22,holoEntity(17):pos()+vec(0,0,-30)),holoAng(22,holoEntity(17):angles()+ang(90,0,0)),holoScale(22,vec(0.9,0.9,0.9)),holoModel(22,"models/XQM/Rails/trackball_1.mdl"),holoMaterial(22,"models/props_lab/door_klab01")
holoCreate(23),holoPos(23,holoEntity(22):pos()+vec(30,0,-10)),holoAng(23,holoEntity(22):angles()+ang(20,0,0)),holoScale(23,vec(1,1,1)),holoModel(23,"models/Mechanics/roboticslarge/a1.mdl"),holoMaterial(23,"models/props_lab/door_klab01")
Gun:setPos(holoEntity(23):pos()+vec(30,0,-10))
Gun:setAng(holoEntity(23):angles()+ang(180,0,0))
#Gun:parentTo(holoEntity(23))
}
holoParent(1,entity())
holoParent(2,entity())
holoParent(3,entity())
holoParent(4,entity())
holoParent(5,entity())
holoParent(6,entity())
holoParent(7,entity())
holoParent(8,entity())
holoParent(9,entity())
holoParent(10,entity())
holoParent(11,entity())
holoParent(12,entity())
holoParent(13,entity())
holoParent(14,entity())
holoParent(15,entity())
holoParent(16,entity())
holoParent(17,entity())
holoParent(18,entity())
holoParent(19,entity())
holoParent(20,entity())
holoParent(21,entity())
if(!Aim){Fire=0,holoPos(22,holoEntity(17):pos()+vec(0,0,-30))}
holoParent(23,holoEntity(22))
holoPos(22,holoEntity(17):pos()+vec(0,0,-30))
if(changed(Gun:model())&Gun:model()!=""){entity():setAng(ang(0,0,0)),reset()}
Gun:setPos(holoEntity(23):toWorld(vec(-35,0,0)))
Gun:setAng(holoEntity(23):angles()+ang(180,0,180))


