@name EGP button
@inputs EGP:wirelink User:entity
@outputs B1
@persist Cursor:vector2
#--------------------===============[|EGP EVENT ITEM GIVER/PLAYERMODEL|]===============--------------------
interval(100)

if(first())
    {
        EGP:egpClear()
        EGP:egpDrawTopLeft(1)
        EGP:egpBox(0,vec2(0,0),vec2(10000,10000))
       # EGP:egpRoundedBox(0,vec2(0,0),vec2(10000,10000))
        EGP:egpColor(1,vec(192,0,0))
        #EGP:egpRoundedBoxOutline(2,vec2(220,230),vec2(74,50))
        EGP:egpColor(2,vec(92,103,232)) 
        EGP:egpText(3,"",vec2(169,169))
        EGP:egpColor(3,vec(80,255,0))
        EGP:egpCircle(400,vec2(),vec2(12,12))
        EGP:egpColor(400,vec4(255,255,255,232))
        EGP:egpParentToCursor(400)
        EGP:egpSize(5,5)
    }
Cursor = EGP:egpCursor(User)
if(User&~User)
    {   
        ####################
        User:setModel("models/player/p2_chell.mdl")
        ####################
        User:setHealth(100)
        User:plySetArmor(100)
       # User:plySetSpeed(430)
      #  User:plySetGravity(60)
        ####################
        User:stripWeapons()
        #############
        User:give("weapon_physcannon")
         User:give("pocket")
        User:give("fas2_m24") #Optional#
        User:give("weapon_lordi_wep_knife")
        User:give("weapon_physgun")
        User:give("weapon_shotgun")
        User:give("stunstick")
        User:give("weapon_crossbow")
         User:give("weapon_lordi_wep_awp")
        User:give("weapon_lordi_wep_m249")
        User:give("weapon_lordi_wep_p90")
        User:give("weapon_lordi_wep_ump")
       User:give("weapon_lordi_wep_xm1014")
        User:give("weapon_lordi_wep_sg552")
        User:give("weapon_lordi_wep_minigun")
             User:setAmmo(5000,"buckshot")
User:setAmmo(5000,"smg1")
User:setAmmo(5000,"pistol")
User:setAmmo(5000,"357")
   
        #####EVENT GUNS#####
       # User:give("weapon_pumpshotgun2")
      #  User:give("weapon_p2282")
       #User:give("weapon_lordi_wep_knife")
       #User:give("weapon_laserpistol2")
       # User:setAmmo(100,"item_ammo_smg1")
       #  User:setAmmo(100,"item_box_buckshot")
       #  User:setAmmo(100,"item_ammo_pistol")
    ########HALO WEPS#######WITH SCOTT########
    # User:give("h3_sr_swep")
        #User:give("h3_magnum_swep")
       #User:give("h3_sr_swep")
    #   User:give("weapon_crossbow")
         
        ############
        LeftTop = EGP:egpPos(1)
        RightBottom = EGP:egpPos(1) + EGP:egpSize(1)
        if(inrange(Cursor, LeftTop, RightBottom))
            {
                B1=!B1
                print(3,"Player " + User:name() + " has pressed E on position " + toString(round(Cursor)))
            }
        if(B1) 
            {
                EGP:egpColor(1, vec4(255,255,400,0))
                EGP:egpSetText(3,"HIT E!")
                EGP:egpFont(3,"",50)
            
            }
        if(!B1)
            {
                EGP:egpColor(1, vec4(255,198,255,0))
                EGP:egpSetText(3,"DONE!")
            }
    }
