Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.51 KB | None | 0 0
  1. @name Garry
  2. @model models/props_junk/watermelon01.mdl
  3. @persist [ StayPos Vector]:vector Wave Tie SongDur Partying
  4. @persist [O E]:entity
  5. @persist [PropCore CuteFace Song]:string
  6. @persist T:entity Ang:angle AngF:angle INC
  7. @persist I Load
  8.  
  9. #Made by Pefu19, 2013
  10. #Do not remove the hint on the end.
  11. #If you're going to post the code somewhere, give me credit
  12.  
  13.  
  14. Tcone = random(255)
  15. Tctwo= random(255)
  16. Tctree = random(255)
  17. if( first() ) {
  18. Song = "music/hl1_song25_remix3.mp3"
  19. SongDur = 45
  20.  
  21. Partying = 0
  22.  
  23. ShouldHint = 0
  24. runOnChat(1)
  25.  
  26. O = owner()
  27. E = entity()
  28.  
  29. PropCore = "true"
  30.  
  31. #[NOT WORKING]#
  32. CuteFace = "false"
  33. ###############
  34.  
  35. ###CURRENT CHAT COMMANDS###
  36. Hints = array(
  37. "Made by Pefu19, 2013",
  38. "Optimised by Boog, 2017",
  39. "garry be red/green/blue - changes color",
  40. "garry party - parties",
  41. "garry reset color - resets Garry's color",
  42. "garry gtfo - removes Garry :( (why would you do that though)",
  43. "Say Garry to reset constant commands")
  44.  
  45. if( ShouldHint == 1 ) {
  46. for(I=1, Hints:count() ) {
  47. hint( Hints[I,string], 5 )
  48. }
  49. }
  50. else {
  51. hint( "Check the E2 code for commands in the Hints array - Line 26", 5 )
  52. }
  53.  
  54. }
  55. interval(60)
  56.  
  57. Said = O:lastSaid():lower()
  58. Strings = Said:explode(" ")
  59. if( chatClk( O ) ) {
  60.  
  61. switch( Strings[1,string] ) {
  62. default, break
  63.  
  64. case "be",
  65. switch( Strings[2,string] ) {
  66. default, break
  67.  
  68. case "red",
  69. hideChat(1)
  70. E:setColor( vec( 255,0,0 ) )
  71. break
  72.  
  73. case "green",
  74. hideChat(1)
  75. E:setColor( vec( 0,255,0 ) )
  76. break
  77.  
  78. case "blue",
  79. hideChat(1)
  80. E:setColor( vec( 0,0,255 ) )
  81. break
  82. }
  83. break
  84.  
  85. case "party",
  86. Tcone = random(255)
  87. Tctwo= random(255)
  88. Tctree = random(255)
  89. hideChat(1)
  90. E:setTrails(5,0,5,"trails/smoke",vec(Tcone,Tctwo,Tctree),255)
  91. Partying = !Partying
  92.  
  93. if( Partying ) {
  94. soundPlay(1,SongDur,Song)
  95. timer("party",15)
  96. }
  97. else {
  98. stoptimer("party")
  99. soundStop(1)
  100. timer("resetcolor",100)
  101. }
  102.  
  103. break
  104.  
  105. case "garry",
  106. if( Said == "garry change color" ) {
  107. hideChat(1)
  108. E:setColor( vec( random(255),random(255),random(255) ) )
  109. }
  110. elseif( Said == "garry reset color" ) {
  111. hideChat(1)
  112. E:setColor( vec( 255,255,255 ) )
  113. }
  114. elseif( Said == "garry gtfo" ) {
  115. hideChat(1)
  116. print("Why would you do that :[ You Monster")
  117. selfDestructAll()
  118. }
  119. elseif( Said == "garry stay" ) {
  120. hideChat(1)
  121. Tie = 1
  122. StayPos = O:pos()
  123. }
  124. elseif( Said == "garry follow" ) {
  125. hideChat(1)
  126. Tie = 0
  127. }
  128. break
  129.  
  130. case "",
  131. break
  132.  
  133. case "",
  134. break
  135. }
  136. }
  137.  
  138. if( clkName() != "interval" ) {
  139. local Name = clkName()
  140.  
  141. switch( Name ) {
  142. default, break
  143.  
  144. case "party",
  145.  
  146. Wave++
  147. Interval = 25
  148. timer("party",Interval)
  149. if( Wave >= SongDur*1000/Interval ) {
  150. stoptimer("party")
  151. timer("resetcolor",100)
  152. Wave = 1
  153. Partying = 0
  154. }
  155. local R = random(1,255)
  156. local G = random(1,255)
  157. local B = random(1,255)
  158. E:setColor( vec( R,G,B ) )
  159. break
  160.  
  161. case "resetcolor",
  162. if( Wave != 1 ) { Wave = 1, stoptimer("party") }
  163. E:setColor( vec( 255,255,255 ) )
  164. break
  165. }
  166. }
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173. if( Tie == 0 ) {
  174. Vector=owner():pos()-(entity():pos()-vec(25,0,25))
  175. applyForce($Vector*30+Vector)
  176. setName("GarryPet: Following")
  177. }
  178. else {
  179. Vector=StayPos-(entity():pos()-vec(25,0,25))
  180. applyForce($Vector*30+Vector)
  181. setName("GarryPet: Staying")
  182. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement