Advertisement
Guest User

Untitled

a guest
Feb 17th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. @name Event Helper
  2. @inputs Egp:wirelink
  3. @persist [BluePoints Blue Red RedPoints]:table R B [Redspawn Bluespawn]:entity Totalpoints
  4. runOnTick(1)
  5. runOnChat(1)
  6. runOnDeath(1)
  7. runOnSpawn(1)
  8. R=RedPoints:count()
  9. B=BluePoints:count()
  10. if(~Egp & ->Egp){
  11. reset()
  12. }
  13. if(first()){
  14. #chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]: "+owner():name()+" Has Spawned EventHelper, Created By Redware & coolxpress")
  15. Egp:egpClear()
  16. Egp:egpDrawTopLeft(1)
  17. Egp:egpBox(1,vec2(0),vec2(512))
  18. Egp:egpColor(1,vec(30))
  19. Egp:egpBox(2,vec2(30),vec2(450,70))
  20. Egp:egpColor(2,vec(40))
  21. Egp:egpBox(3,vec2(30,130),vec2(210,340))
  22. Egp:egpColor(3,vec(40))
  23. Egp:egpBox(4,vec2(270,130),vec2(210,340))
  24. Egp:egpColor(4,vec(40))
  25. Egp:egpBox(5,vec2(30,130),vec2(210,60))
  26. Egp:egpColor(5,vec(150,0,0))
  27. Egp:egpBox(6,vec2(270,130),vec2(210,60))
  28. Egp:egpColor(6,vec(0,0,150))
  29. Egp:egpText(7,"Event ScoreBoard",vec2(70,40))
  30. Egp:egpSize(7,50)
  31. Egp:egpText(8,"Team Red",vec2(50,140))
  32. Egp:egpSize(8,40)
  33. Egp:egpText(9,"Team Blue",vec2(285,140))
  34. Egp:egpSize(9,40)
  35. Egp:egpText(10,"0",vec2(100,256))
  36. Egp:egpSize(10,150)
  37. Egp:egpText(11,"0",vec2(340,256))
  38. Egp:egpSize(11,150)
  39. Totalpoints=3
  40. }
  41. Egp:egpSetText(10,RedPoints[R,normal]+"")
  42. Egp:egpSetText(11,BluePoints[B,normal]+"")
  43. if(chatClk()){
  44. P=lastSpoke()
  45. C1=teamColor(lastSpoke():team())
  46. Message = P:lastSaid():explode(" ")
  47. W1 = Message:shiftString()
  48. W2 = Message:shiftString()
  49. Q=toChar(34)
  50. if(W1=="!blue"){
  51. if(Bluespawn:isValid()){
  52. # P:teleport(Bluespawn:pos())
  53. }
  54. #chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]:",C1,P:name(),vec(0,255,0)," has joined the",vec(0,0,255)," Blue",vec(0,255,0)," team")
  55.  
  56. Blue[P:name(),entity]=P
  57. Red[P:name(),entity]=noentity()
  58. }
  59. if(W1=="!red"){
  60. if(Redspawn:isValid()){
  61. # P:teleport(Redspawn:pos())
  62. }
  63. #chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]: ",C1,P:name(),vec(0,255,0)," has joined the",vec(255,0,0)," Red",vec(0,255,0)," team")
  64. Red[P:name(),entity]=P
  65. Blue[P:name(),entity]=noentity()
  66. }
  67. if(W1=="!quit"){
  68. # chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]: ",C1,P:name(),vec(0,255,0)," has quit the game")
  69.  
  70. Red[P:name(),entity]=noentity()
  71. Blue[P:name(),entity]=noentity()
  72.  
  73.  
  74. }
  75. }
  76.  
  77. foreach(I,L:entity=Blue){
  78. if(lastDeathAttacker()==L&deathClk()){
  79. BluePoints[B+1,normal]=BluePoints[B,normal]+1
  80. Egp:egpSetText(11,B:toString()+"")
  81.  
  82. }
  83. foreach(O,D:entity=Red){
  84. if(lastDeathAttacker()==D&deathClk()){
  85. RedPoints[R+1,normal]=RedPoints[R,normal]+1
  86. Egp:egpSetText(10,R:toString()+"")
  87. }
  88. if(D==lastSpawnedPlayer()&spawnClk()){
  89. # D:teleport(Redspawn:pos())
  90. }
  91. if(L==lastSpawnedPlayer()&spawnClk()){
  92. #L:teleport(Bluespawn:pos())
  93. }
  94. }
  95. }
  96. if(chatClk(owner())){
  97. Message = P:lastSaid():explode(" ")
  98. W1 = Message:shiftString()
  99. W2 = Message:shiftString()
  100. Q=toChar(34)
  101. if(W1=="!spawn"){
  102. if(W2=="blue"){
  103. if(!Bluespawn:isValid()){
  104. Bluespawn=holoCreate(1)
  105. holoPos(1,owner():aimPos())
  106. holoColor(1,vec(0,0,255))
  107.  
  108. }
  109. }
  110. if(W2=="red"){
  111. if(!Redspawn:isValid()){
  112. Redspawn=holoCreate(2)
  113. holoPos(2,owner():aimPos())
  114. holoColor(2,vec(255,0,0))}
  115. }
  116.  
  117. }
  118. }
  119. if(BluePoints[B,normal]==Totalpoints){
  120. #chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]: Game Over!",vec(255,0,0)," Red",vec(0,255,0),"Wins!")
  121. BluePoints:clear()
  122. Blue:clear()
  123. }
  124. if(RedPoints[R,normal]==Totalpoints){
  125. #chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]: Game Over!",vec(0,0,255)," Blue",vec(0,255,0),"Wins!")
  126. RedPoints:clear()
  127. Red:clear()
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement