@name Gun Store Tutorial !!!
@inputs EGP:wirelink
@inputs R1 R2 R3 R4 
@inputs Left Right Enter Money
@outputs U1 U2 U3 U4 UM
@persist Index Items:array Prices:array Stats:array

if(first() | duped()){
    EGP:egpClear()
    Items = array("M4A1","Sniper","AK47", "MP5")
    Prices = array(600,925, 400, 10000)
    Stats = array("DMG: 30","DMG: 90","DMG: 20","DMG: 17")
    #Creating a Header
    EGP:egpText(1,"Gun Store Tutorial",vec2(150, 30))
    EGP:egpSize(1, 30)
    #Creating a line
    EGP:egpLine(2, vec2(0, 70), vec2(1000,70))
    EGP:egpSize(2, 4)
    EGP:egpColor(2, vec(255,0,0))
    
    #Creating Base
    EGP:egpText(3, "Item Name: ", vec2(40, 100))
    EGP:egpSize(3, 30)
    EGP:egpText(4, "Item Price: ", vec2(40, 150))
    EGP:egpSize(4, 30)
    EGP:egpText(5,"Stats: ", vec2(30, 250))
    EGP:egpSize(5, 20)
    
    }

if(Left & ~Left){
    Index--
    }
if(Right & ~Right){
    Index++
    EGP:egpRemove(Index-1)
    EGP:egpText(5+Index, Items[Index, string], vec2(90, 100))
    EGP:egpSize(5+Index, 30)
    }

if(Index < 1){
    Index = 4
    }
if(Index > 4){
    Index = 1
    }


    

