Advertisement
Zenthetic

Untitled

Sep 4th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. @name Hobo turtles
  2. @outputs Holo Rand ModelAny Rand2 Water R A:array DebugMode Sleep SleepMode SleepTime
  3. @trigger all
  4. @model models/props/de_tides/Vending_turtle.mdl
  5.  
  6. ##############################################
  7. # Added Swiming,Fliping and Hats & SleepMode #
  8. ##############################################
  9.  
  10. E = entity()
  11. Water = entity():isUnderWater()
  12. O = owner()
  13.  
  14.  
  15. findByModel("models/props/de_tides/Vending_turtle.mdl")
  16. A = findToArray()
  17.  
  18. if(first()){
  19. hint("Made by FailCake",7)
  20. hint("Total Turtles = " + A:count(),7)
  21.  
  22.  
  23.  
  24. #### CONFIG ####
  25. DebugMode = 0 ## Debug ##
  26. SleepMode = 1 ## Turtles should sleep or not. ##
  27. SleepTime = 30 ## seconds to jump before sleep ##
  28. ModelAny = 0 ## Is there HoloModelAny? If not put 0 ##
  29. #### CONFIG ####
  30.  
  31.  
  32.  
  33. Rand = randint(1,6)
  34. Sleep = 0
  35.  
  36. if(Rand == 1){
  37. Holo = 1
  38. }elseif(Rand == 2){
  39. Holo = 0
  40. }elseif(Rand == 3){
  41. Holo = 2
  42. }elseif(Rand == 4){
  43. Holo = 3
  44. }elseif(Rand == 5){
  45. Holo = 4
  46. }elseif(Rand == 6){
  47. Holo = 5
  48. }
  49. if(DebugMode){
  50. hint("Rand = "+ Rand,7)
  51. }
  52. }
  53.  
  54. Rand2 = randint(1000,2000)
  55. Move=array()
  56. Move:setString(1,"player/footsteps/slosh1.wav")
  57. Move:setString(2,"player/footsteps/slosh2.wav")
  58. Move:setString(3,"player/footsteps/slosh3.wav")
  59. Move:setString(4,"player/footsteps/slosh4.wav")
  60.  
  61.  
  62. timer("jump",Rand2)
  63.  
  64. if(Sleep == 0){
  65. if(clk("jump")){
  66. Ang = E:angles():roll()
  67. if(Water == 0){
  68. if(Ang<170){
  69. E:applyForce(-E:right() * 200 + E:up() * 200)
  70. E:soundPlay(100,100,"ambient/levels/canals/drip4.wav")
  71. soundPitch(100,200)
  72. }
  73. else{
  74. E:applyTorque(E:forward() * 1700)
  75. E:soundPlay(100,100,"ambient/levels/canals/drip4.wav")
  76. soundPitch(100,200)
  77. }
  78. }else{
  79. E:applyForce(-E:right() * 300)
  80. E:soundPlay(7331,0,Move:string(R))
  81. R=randint(1,4)
  82. }
  83. }else{
  84. E:applyForce(vec(0,0,0))
  85. }
  86. }else{
  87. E:soundPlay(100,100,"ui/gamestartup10.mp3")
  88. }
  89.  
  90. if(Holo & holoCanCreate() & ModelAny){
  91. if(Holo == 1){
  92. holoCreate(1)
  93. holoModel(1,"models/props/de_tides/Vending_hat.mdl")
  94. holoPos(1,E:toWorld(vec(0,6,5)))
  95. holoScale(1,vec(0.8,0.8,0.8))
  96. holoParent(1,E)
  97. holoDelete(3)
  98. holoDelete(2)
  99. }
  100.  
  101. if(Holo == 2){
  102. holoCreate(1)
  103. holoModel(1,"models/props/de_tides/Vending_hat.mdl")
  104. holoPos(1,E:toWorld(vec(0,6,5)))
  105. holoScale(1,vec(0.8,0.8,0.8))
  106. holoParent(1,E)
  107. holoDelete(3)
  108. holoDelete(2)
  109. holoDelete(4)
  110. holoAng(1,E:toWorld(ang(0,180,30)))
  111. }
  112.  
  113. if(Holo == 3){
  114. holoCreate(2)
  115. holoModel(2,"models/Effects/bday_hat.mdl")
  116. holoPos(2,E:toWorld(vec(0,5,6.5)))
  117. holoScale(2,vec(1.2,1.2,1.2))
  118. holoAng(2,E:toWorld(ang(0,180,-30)))
  119. holoParent(2,E)
  120. holoDelete(1)
  121. holoDelete(3)
  122. holoDelete(4)
  123. }
  124.  
  125. if(Holo == 4){
  126. holoCreate(3)
  127. holoModel(3,"models/chefHat.mdl")
  128. holoPos(3,E:toWorld(vec(0,5,6.4)))
  129. holoScale(3,vec(0.5,0.5,0.5))
  130. holoAng(3,E:toWorld(ang(0,180,-30)))
  131. holoParent(3,E)
  132. holoDelete(1)
  133. holoDelete(2)
  134. holoDelete(4)
  135. }
  136.  
  137. if(Holo == 5){
  138. holoCreate(4)
  139. holoModel(4,"models/props_2fort/hardhat001.mdl")
  140. holoPos(4,E:toWorld(vec(0,5,6.4)))
  141. holoScale(4,vec(0.4,0.4,0.4))
  142. holoAng(4,E:toWorld(ang(0,-90,0)))
  143. holoParent(4,E)
  144. holoDelete(1)
  145. holoDelete(2)
  146. holoDelete(3)
  147. }
  148.  
  149. }else{
  150. holoDelete(3)
  151. holoDelete(2)
  152. holoDelete(1)
  153. holoDelete(4)
  154. }
  155.  
  156. if(SleepMode == 1){
  157. if(Sleep == 0){
  158. timer("sleep",SleepTime*1000)
  159. }
  160. if(Sleep == 1){
  161. timer("wake",10000)
  162. }
  163.  
  164. if(clk("sleep")){
  165. Sleep = 1
  166. stoptimer("sleep")
  167. if(DebugMode){
  168. hint("Turtle Going to Sleep",7)
  169. }
  170. }
  171. if(clk("wake")){
  172. Sleep = 0
  173. stoptimer("wake")
  174. if(DebugMode){
  175. hint("Turtle Going to Wake",7)
  176. }
  177. }
  178. }
  179.  
  180.  
  181. if(duped()){selfDestructAll()}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement