Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name basic touchscreen EGP
- @inputs Egp:wirelink User:entity
- @outputs
- @persist Index
- @trigger User
- #interval(200)
- if(first()|dupefinished()|changed(Egp:entity())){
- function number egpClick(Player:entity,Egp:wirelink,ID){
- return inrange(Egp:egpCursor(Player),Egp:egpPos(ID)-(Egp:egpSize(ID)/2),Egp:egpPos(ID)+(Egp:egpSize(ID)/2))
- }#LuckyGuys costum function dont touch it :P
- Index=0
- } #That above is not to be edited.
- #if(changed(User)&User){
- # timer("Reset",40000)
- #} #this will reset the code if someone doesnt click on it after 40 seconds
- if(Index==0 | clk("Reset")){ #This is your starting screen.
- Egp:egpClear() #This clears the EGP board
- Egp:egpRoundedBox(1,vec2(256,35),vec2(500,50)),Egp:egpColor(1,vec(160,160,160)) #This draws a box
- Egp:egpText(2,"Text Here",vec2(20,15)),Egp:egpColor(2,vec(255,0,0)), Egp:egpSize(2, 35) #This draws text
- Index=1 #This is telling the code to go to Index 1
- }elseif(Index==1){ #This is Index 1
- if(User&~User){
- if(egpClick(User,Egp,1)){ #If the user clicks entity 1, or the egpRoundedBox drawn above
- Index=2 # it'll go to screen 2. Or Index 2 or Screen 2
- }
- }
- }elseif(Index==2){ #Same thing over again.
- Egp:egpClear()
- Egp:egpRoundedBox(28,vec2(256,155),vec2(500,50)),Egp:egpColor(28,vec(160,160,160))
- Egp:egpText(29,"New Screen",vec2(80,10)), Egp:egpColor(29,vec(255,0,0)), Egp:egpSize(29,40)
- Index=3
- }elseif(Index==3){
- if(User&~User){
- if(egpClick(User,Egp,28)){
- Index=0
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement