Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. @name basic touchscreen EGP
  2. @inputs Egp:wirelink User:entity
  3. @outputs
  4. @persist Index
  5. @trigger User
  6. #interval(200)
  7. if(first()|dupefinished()|changed(Egp:entity())){
  8. function number egpClick(Player:entity,Egp:wirelink,ID){
  9. return inrange(Egp:egpCursor(Player),Egp:egpPos(ID)-(Egp:egpSize(ID)/2),Egp:egpPos(ID)+(Egp:egpSize(ID)/2))
  10. }#LuckyGuys costum function dont touch it :P
  11.  
  12. Index=0
  13. } #That above is not to be edited.
  14.  
  15. #if(changed(User)&User){
  16. # timer("Reset",40000)
  17. #} #this will reset the code if someone doesnt click on it after 40 seconds
  18.  
  19. if(Index==0 | clk("Reset")){ #This is your starting screen.
  20. Egp:egpClear() #This clears the EGP board
  21. Egp:egpRoundedBox(1,vec2(256,35),vec2(500,50)),Egp:egpColor(1,vec(160,160,160)) #This draws a box
  22. Egp:egpText(2,"Text Here",vec2(20,15)),Egp:egpColor(2,vec(255,0,0)), Egp:egpSize(2, 35) #This draws text
  23. Index=1 #This is telling the code to go to Index 1
  24. }elseif(Index==1){ #This is Index 1
  25. if(User&~User){
  26. if(egpClick(User,Egp,1)){ #If the user clicks entity 1, or the egpRoundedBox drawn above
  27. Index=2 # it'll go to screen 2. Or Index 2 or Screen 2
  28. }
  29. }
  30. }elseif(Index==2){ #Same thing over again.
  31. Egp:egpClear()
  32. Egp:egpRoundedBox(28,vec2(256,155),vec2(500,50)),Egp:egpColor(28,vec(160,160,160))
  33. Egp:egpText(29,"New Screen",vec2(80,10)), Egp:egpColor(29,vec(255,0,0)), Egp:egpSize(29,40)
  34. Index=3
  35. }elseif(Index==3){
  36. if(User&~User){
  37. if(egpClick(User,Egp,28)){
  38. Index=0
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement