@name Auto Store
@inputs E:wirelink User:entity [R1 R2 R3 R4 R5 R6]:entity
@outputs Cursor:vector2 Page Count Player:entity [U1 U2 U3 U4 U5 U6]
@persist Using:entity Timer
@trigger EgpUser
@inputs EgpUser:entity
 
interval(5)
runOnChat(1)
 if(first()){
    function number wirelink:egpClick(Player:entity,ID){
        local Half=This:egpSize(ID)/2
        return inrange(This:egpCursor(Player),This:egpPos(ID)-Half,This:egpPos(ID)+Half)
    }
}
####
#CanClick=changed(owner():keyUse())&owner():keyUse()&owner():pos():distance(holoEntity(1000):pos())<=100
#CanClick2=(changed(owner():keyUse())&owner():keyUse()&owner():pos():distance(holoEntity(1001):pos())<=100)
if (changed(owner():keyUse()) & owner():keyUse()){
    # holoCreate(10056)
    }
#if(CanClick)
#{
#print("Works!") 
#}

####
Timer=Timer+1*1
T=Timer
E2 = entity()
E2Sp = entity():pos() 
E2:propNotSolid(0) # Change me to 1 if you don't want a cunt admin to dupe this.
 
if(first()){
setName("AutoStoreV3 |
Author:  Erza     
Version: v3")
    Page = 1
}
 
function createGunHolo()
{
    holoCreate(1)
    holoModel(1,"models/weapons/w_smg_p90.mdl")
    holoPos(1,E2:pos()+vec(0,0,10))
    holoAng(1,ang(0,T,0))
    
}
 
if(Page == 1)
{
    #E:egpClear()
    #Background
    E:egpRoundedBox(1,vec2(250,250),vec2(550,550))
    E:egpMaterial(1,"gui/gradient")
    E:egpColor(1,vec(0,0,255))
    #Background
   
    #Text Box
    E:egpRoundedBox(2,vec2(250,125),vec2(250,150))
    E:egpColor(2,vec(57,57,57))
    #Text Box
   
    #Text
    E:egpText(3,"Armory",vec2(145,65)),E:egpSize(3,40)
    E:egpText(4,"By Erza",vec2(156,125)),E:egpSize(4,55)
    #Text
   
    #Login Box Outline
    E:egpRoundedBox(5,vec2(250,350),vec2(250,150)),E:egpColor(5,vec(255,255,255))
    #Login Box Outline
   
    #Login Box
    E:egpRoundedBox(6,vec2(250,350),vec2(240,140))
    E:egpColor(6,vec(0,0,255))
    #Login Box
   
    #Login Text
    E:egpText(7,"Press",vec2(165,285)),E:egpSize(7,50)
    E:egpText(8,"E (Use)",vec2(165,325)),E:egpSize(8,50)
    E:egpText(9,"To Begin",vec2(165,365)),E:egpSize(9,50)
    #Login Text
}
Cursor  =  E:egpCursor(User)
if(Page == 1 | Page == 2){
    E:egpAlpha(1,255)
    E:egpAlpha(2,255)
    E:egpAlpha(3,255)
    E:egpAlpha(4,255)
    E:egpAlpha(5,255)
    E:egpAlpha(6,255)
    E:egpAlpha(7,255)
    E:egpAlpha(8,255)
    E:egpAlpha(9,255)
    E:egpAlpha(10,0)
    E:egpAlpha(11,0)
    E:egpAlpha(12,0)
    E:egpAlpha(15,0)
}
 
else{
    for(I = 1,9){
        E:egpAlpha(I,0)
    }
}
if(User:isValid() && Page == 1){
    if(inrange(Cursor,E:egpPos(6)-E:egpSize(6)/2,E:egpPos(6)+E:egpSize(6)/2)){
        Page = 2
        Player = User
    }
}
if(Page == 2){
    if(Count < 256){
    Count+=1
    for(I = 1,9){
        E:egpPos(I,E:egpPos(I)-vec2(2,0))
    }
}
if(Count >= 256){
    Count = 0
    Page = 3
}
}
 
if(Page == 3){
    E:egpClear()
    #Top Bar
    E:egpRoundedBox(10,vec2(256,90),vec2(490,90))
    E:egpColor(10,vec(0,0,255))
    #Top Bar
   
    #Welcome Text
    E:egpText(11,"Welcome, "+Player:name(),vec2(75,70)),E:egpSize(11,35)
    #Welcome Text
   ################Button


Erza = owner():lastSaid():explode(" ")
if(Erza[1,string]=="-BootUp" & chatClk(owner())){
print("DEBUG: Booted")
entSpawn("m9k_smgp90",E2Sp)
#createGunHolo()

}
   #################
    #Weapon Holo
    createGunHolo()
    #entSpawn("m9k_smgp90",E2Sp)
    #Weapon Holo
   
    ####################################
    #WHAT THE FUCK WHY CAN'T I ADD SHIT#
    ####################################
   # E:egpRoundedBox(99,vec2(250,250),vec2(50,50))
#    E:egpText(100,"lol",vec2(250,250))
    ####################################
    #WHAT THE FUCK WHY CAN'T I ADD SHIT#
    ####################################
   
}

 
if(Player:pos():distance(E:entity():pos())>180){
    Page = 1
    holoDeleteAll()
}
