Advertisement
lcast15

Alternating Lights GMOD E2

Oct 29th, 2016
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. @name Lcast's Light Alternator
  2. @inputs ON OFF
  3. @outputs Blue:vector Red:vector
  4. @persist I IDLE Active
  5. runOnChat(1)
  6.  
  7. C = owner():lastSaid():explode(" ")
  8.  
  9.  
  10.  
  11. #Button Stuff
  12.  
  13.  
  14. if(ON){
  15. IDLE = 1
  16. }
  17.  
  18. if(OFF){
  19. IDLE = 0
  20. }
  21.  
  22.  
  23.  
  24. #Chat Command Stuff
  25. if(chatClk(owner()))
  26. {
  27. if(C[1,string]=="-siron")
  28. {
  29. hideChat(1)
  30. IDLE = 1
  31.  
  32. }elseif(C[1,string]=="-siroff")
  33. {
  34. hideChat(1)
  35. IDLE = 0
  36. Blue=vec(0)
  37. Red=vec(0)
  38. }
  39. }
  40.  
  41.  
  42.  
  43.  
  44. #What makes the lights alternate
  45. if(IDLE==1){
  46. if(I==1){
  47. IDLE = 1
  48. Red = vec(255,0,0)
  49. Blue = vec(0)
  50. I=0
  51.  
  52. }else{
  53. IDLE = 1
  54. Red = vec(0)
  55. Blue = vec(0,0,255)
  56. I=1
  57. }
  58. interval(500) #this affects the blink rate
  59. }
  60.  
  61. if(IDLE==0){
  62. Red = vec(0)
  63. Blue = vec(0)
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement