AoTTG_Fall_Damage_v1.0.0

Download Raw Clone


  1. OnRoundStart()
  2. {
  3. Game.PrintMessage("<size=17>Fall_Damage_Custom_Logic</size>");
  4. Game.PrintMessage("<size=12>Ensure_player_count_does_not_exceed_10</size>");
  5. VariableFloat.Set("speedThreshold", 13.0);
  6. VariableFloat.Set("xThreshold", 15.0);
  7. VariableFloat.Set("yThreshold", 75.0);
  8. VariableFloat.Set("zThreshold", 15.0);
  9. VariableFloat.Set("nxThreshold", -15.0);
  10. VariableFloat.Set("nyThreshold", -15.0);
  11. VariableFloat.Set("nzThreshold", -15.0);
  12. VariableFloat.Set("clearance", 0.5);
  13. VariableFloat.Set("nclearance", -0.5);
  14. VariableInt.Set("scriptCounter", 0);
  15. VariableFloat.Set("oldSpeed0", 0.0);
  16. VariableFloat.Set("oldSpeed1", 0.0);
  17. VariableFloat.Set("oldSpeed2", 0.0);
  18. VariableFloat.Set("oldSpeed3", 0.0);
  19. VariableFloat.Set("oldSpeed4", 0.0);
  20. VariableFloat.Set("oldSpeed5", 0.0);
  21. VariableFloat.Set("oldSpeed6", 0.0);
  22. VariableFloat.Set("oldSpeed7", 0.0);
  23. VariableFloat.Set("oldSpeed8", 0.0);
  24. VariableFloat.Set("oldSpeed9", 0.0);
  25. VariableFloat.Set("eoldSpeed0", 0.0);
  26. VariableFloat.Set("eoldSpeed1", 0.0);
  27. VariableFloat.Set("eoldSpeed2", 0.0);
  28. VariableFloat.Set("eoldSpeed3", 0.0);
  29. VariableFloat.Set("eoldSpeed4", 0.0);
  30. VariableFloat.Set("eoldSpeed5", 0.0);
  31. VariableFloat.Set("eoldSpeed6", 0.0);
  32. VariableFloat.Set("eoldSpeed7", 0.0);
  33. VariableFloat.Set("eoldSpeed8", 0.0);
  34. VariableFloat.Set("eoldSpeed9", 0.0);
  35. VariableFloat.Set("x0", 0.0);
  36. VariableFloat.Set("x1", 0.0);
  37. VariableFloat.Set("x2", 0.0);
  38. VariableFloat.Set("x3", 0.0);
  39. VariableFloat.Set("x4", 0.0);
  40. VariableFloat.Set("x5", 0.0);
  41. VariableFloat.Set("x6", 0.0);
  42. VariableFloat.Set("x7", 0.0);
  43. VariableFloat.Set("x8", 0.0);
  44. VariableFloat.Set("x9", 0.0);
  45. VariableFloat.Set("y0", 0.0);
  46. VariableFloat.Set("y1", 0.0);
  47. VariableFloat.Set("y2", 0.0);
  48. VariableFloat.Set("y3", 0.0);
  49. VariableFloat.Set("y4", 0.0);
  50. VariableFloat.Set("y5", 0.0);
  51. VariableFloat.Set("y6", 0.0);
  52. VariableFloat.Set("y7", 0.0);
  53. VariableFloat.Set("y8", 0.0);
  54. VariableFloat.Set("y9", 0.0);
  55. VariableFloat.Set("z0", 0.0);
  56. VariableFloat.Set("z1", 0.0);
  57. VariableFloat.Set("z2", 0.0);
  58. VariableFloat.Set("z3", 0.0);
  59. VariableFloat.Set("z4", 0.0);
  60. VariableFloat.Set("z5", 0.0);
  61. VariableFloat.Set("z6", 0.0);
  62. VariableFloat.Set("z7", 0.0);
  63. VariableFloat.Set("z8", 0.0);
  64. VariableFloat.Set("z9", 0.0);
  65. VariableFloat.Set("vx0", 0.0);
  66. VariableFloat.Set("vx1", 0.0);
  67. VariableFloat.Set("vx2", 0.0);
  68. VariableFloat.Set("vx3", 0.0);
  69. VariableFloat.Set("vx4", 0.0);
  70. VariableFloat.Set("vx5", 0.0);
  71. VariableFloat.Set("vx6", 0.0);
  72. VariableFloat.Set("vx7", 0.0);
  73. VariableFloat.Set("vx8", 0.0);
  74. VariableFloat.Set("vx9", 0.0);
  75. VariableFloat.Set("vy0", 0.0);
  76. VariableFloat.Set("vy1", 0.0);
  77. VariableFloat.Set("vy2", 0.0);
  78. VariableFloat.Set("vy3", 0.0);
  79. VariableFloat.Set("vy4", 0.0);
  80. VariableFloat.Set("vy5", 0.0);
  81. VariableFloat.Set("vy6", 0.0);
  82. VariableFloat.Set("vy7", 0.0);
  83. VariableFloat.Set("vy8", 0.0);
  84. VariableFloat.Set("vy9", 0.0);
  85. VariableFloat.Set("vz0", 0.0);
  86. VariableFloat.Set("vz1", 0.0);
  87. VariableFloat.Set("vz2", 0.0);
  88. VariableFloat.Set("vz3", 0.0);
  89. VariableFloat.Set("vz4", 0.0);
  90. VariableFloat.Set("vz5", 0.0);
  91. VariableFloat.Set("vz6", 0.0);
  92. VariableFloat.Set("vz7", 0.0);
  93. VariableFloat.Set("vz8", 0.0);
  94. VariableFloat.Set("vz9", 0.0);
  95. VariableFloat.Set("evx0", 0.0);
  96. VariableFloat.Set("evx1", 0.0);
  97. VariableFloat.Set("evx2", 0.0);
  98. VariableFloat.Set("evx3", 0.0);
  99. VariableFloat.Set("evx4", 0.0);
  100. VariableFloat.Set("evx5", 0.0);
  101. VariableFloat.Set("evx6", 0.0);
  102. VariableFloat.Set("evx7", 0.0);
  103. VariableFloat.Set("evx8", 0.0);
  104. VariableFloat.Set("evx9", 0.0);
  105. VariableFloat.Set("evy0", 0.0);
  106. VariableFloat.Set("evy1", 0.0);
  107. VariableFloat.Set("evy2", 0.0);
  108. VariableFloat.Set("evy3", 0.0);
  109. VariableFloat.Set("evy4", 0.0);
  110. VariableFloat.Set("evy5", 0.0);
  111. VariableFloat.Set("evy6", 0.0);
  112. VariableFloat.Set("evy7", 0.0);
  113. VariableFloat.Set("evy8", 0.0);
  114. VariableFloat.Set("evy9", 0.0);
  115. VariableFloat.Set("evz0", 0.0);
  116. VariableFloat.Set("evz1", 0.0);
  117. VariableFloat.Set("evz2", 0.0);
  118. VariableFloat.Set("evz3", 0.0);
  119. VariableFloat.Set("evz4", 0.0);
  120. VariableFloat.Set("evz5", 0.0);
  121. VariableFloat.Set("evz6", 0.0);
  122. VariableFloat.Set("evz7", 0.0);
  123. VariableFloat.Set("evz8", 0.0);
  124. VariableFloat.Set("evz9", 0.0);
  125. }
  126. OnUpdate()
  127. {
  128. VariableInt.Set("counter", 0);
  129. VariablePlayer.Set("player", VariablePlayer("null"));
  130. ForeachPlayer("player")
  131. {
  132. VariableString.Concat("xDir","x",VariableInt("counter").ConvertToString());
  133. VariableString.Concat("yDir","y",VariableInt("counter").ConvertToString());
  134. VariableString.Concat("zDir","z",VariableInt("counter").ConvertToString());
  135. VariableString.Concat("vxDir","vx",VariableInt("counter").ConvertToString());
  136. VariableString.Concat("vyDir","vy",VariableInt("counter").ConvertToString());
  137. VariableString.Concat("vzDir","vz",VariableInt("counter").ConvertToString());
  138. VariableString.Concat("evxDir","evx",VariableInt("counter").ConvertToString());
  139. VariableString.Concat("evyDir","evy",VariableInt("counter").ConvertToString());
  140. VariableString.Concat("evzDir","evz",VariableInt("counter").ConvertToString());
  141. VariableFloat.Set("x", VariablePlayer("player").GetPositionX());
  142. VariableFloat.Set("y", VariablePlayer("player").GetPositionY());
  143. VariableFloat.Set("z", VariablePlayer("player").GetPositionZ());
  144. VariableFloat.Subtract("x", VariableFloat(VariableString("xDir")));
  145. VariableFloat.Subtract("y", VariableFloat(VariableString("yDir")));
  146. VariableFloat.Subtract("z", VariableFloat(VariableString("zDir")));
  147. VariableFloat.Set("vx", VariableFloat("x"));
  148. VariableFloat.Set("vy", VariableFloat("y"));
  149. VariableFloat.Set("vz", VariableFloat("z"));
  150. VariableFloat.Set("x", VariablePlayer("player").GetPositionX());
  151. VariableFloat.Set("y", VariablePlayer("player").GetPositionY());
  152. VariableFloat.Set("z", VariablePlayer("player").GetPositionZ());
  153. VariableString.Concat("oldSpeedDir","oldSpeed",VariableInt("counter").ConvertToString());
  154. VariableString.Concat("eoldSpeedDir","eoldSpeed",VariableInt("counter").ConvertToString());
  155. VariableFloat.Set("speedCompareTemp", VariableFloat(VariableString("oldSpeedDir")));
  156. VariableFloat.Add("speedCompareTemp", VariableFloat("speedThreshold"))
  157. If(Float.GreaterThan(VariableFloat(VariableString("eoldSpeedDir")), VariableFloat("speedCompareTemp")))
  158. {
  159. If(Float.GreaterThan(VariableFloat(VariableString("vxDir")), VariableFloat("xThreshold")))
  160. {
  161. If(Float.GreaterThan(VariableFloat(VariableString("evxDir")), 0.0))
  162. {
  163. If(Float.LessThan(VariableFloat("vx"), VariableFloat("clearance")))
  164. {
  165. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  166. }
  167. }
  168. If(Float.LessThan(VariableFloat(VariableString("evxDir")), 0.0))
  169. {
  170. If(Float.GreaterThan(VariableFloat("vx"), VariableFloat("nclearance")))
  171. {
  172. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  173. }
  174. }
  175. }
  176. If(Float.LessThan(VariableFloat(VariableString("vxDir")), VariableFloat("nxThreshold")))
  177. {
  178. If(Float.GreaterThan(VariableFloat(VariableString("evxDir")), 0.0))
  179. {
  180. If(Float.LessThan(VariableFloat("vx"), VariableFloat("clearance")))
  181. {
  182. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  183. }
  184. }
  185. If(Float.LessThan(VariableFloat(VariableString("evxDir")), 0.0))
  186. {
  187. If(Float.GreaterThan(VariableFloat("vx"), VariableFloat("nclearance")))
  188. {
  189. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  190. }
  191. }
  192. }
  193. If(Float.GreaterThan(VariableFloat(VariableString("vzDir")), VariableFloat("zThreshold")))
  194. {
  195. If(Float.GreaterThan(VariableFloat(VariableString("evzDir")), 0.0))
  196. {
  197. If(Float.LessThan(VariableFloat("vz"), VariableFloat("clearance")))
  198. {
  199. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  200. }
  201. }
  202. If(Float.LessThan(VariableFloat(VariableString("evzDir")), 0.0))
  203. {
  204. If(Float.GreaterThan(VariableFloat("vz"), VariableFloat("nclearance")))
  205. {
  206. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  207. }
  208. }
  209. }
  210. If(Float.LessThan(VariableFloat(VariableString("vzDir")), VariableFloat("nzThreshold")))
  211. {
  212. If(Float.GreaterThan(VariableFloat(VariableString("evzDir")), 0.0))
  213. {
  214. If(Float.LessThan(VariableFloat("vz"), VariableFloat("clearance")))
  215. {
  216. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  217. }
  218. }
  219. If(Float.LessThan(VariableFloat(VariableString("evzDir")), 0.0))
  220. {
  221. If(Float.GreaterThan(VariableFloat("vz"), VariableFloat("nclearance")))
  222. {
  223. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  224. }
  225. }
  226. }
  227. If(Float.GreaterThan(VariableFloat(VariableString("vyDir")), VariableFloat("yThreshold")))
  228. {
  229. If(Float.GreaterThan(VariableFloat(VariableString("evyDir")), 0.0))
  230. {
  231. If(Float.LessThan(VariableFloat("vy"), VariableFloat("clearance")))
  232. {
  233. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  234. }
  235. }
  236. If(Float.LessThan(VariableFloat(VariableString("evyDir")), 0.0))
  237. {
  238. If(Float.GreaterThan(VariableFloat("vy"), VariableFloat("nclearance")))
  239. {
  240. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  241. }
  242. }
  243. }
  244. If(Float.LessThan(VariableFloat(VariableString("vyDir")), VariableFloat("nyThreshold")))
  245. {
  246. If(Float.GreaterThan(VariableFloat(VariableString("evyDir")), 0.0))
  247. {
  248. If(Float.LessThan(VariableFloat("vy"), VariableFloat("clearance")))
  249. {
  250. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  251. }
  252. }
  253. If(Float.LessThan(VariableFloat(VariableString("evyDir")), 0.0))
  254. {
  255. If(Float.GreaterThan(VariableFloat("vy"), VariableFloat("nclearance")))
  256. {
  257. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  258. }
  259. }
  260. }
  261. }
  262. VariableFloat.Set(VariableString("xDir"), VariableFloat("x"));
  263. VariableFloat.Set(VariableString("yDir"), VariableFloat("y"));
  264. VariableFloat.Set(VariableString("zDir"), VariableFloat("z"));
  265. VariableFloat.Set(VariableString("evxDir"), VariableFloat(VariableString("vxDir")));
  266. VariableFloat.Set(VariableString("evyDir"), VariableFloat(VariableString("vyDir")));
  267. VariableFloat.Set(VariableString("evzDir"), VariableFloat(VariableString("vzDir")));
  268. VariableFloat.Set(VariableString("vxDir"), VariableFloat("vx"));
  269. VariableFloat.Set(VariableString("vyDir"), VariableFloat("vy"));
  270. VariableFloat.Set(VariableString("vzDir"), VariableFloat("vz"));
  271. VariableFloat.Set("playerSpeed", VariablePlayer("player").GetSpeed());
  272. VariableFloat.Set(VariableString("eoldSpeedDir"), VariableFloat(VariableString("oldSpeedDir")));
  273. VariableFloat.Set(VariableString("oldSpeedDir"), VariableFloat("playerSpeed"));
  274. VariableInt.Add("counter", 1);
  275. }
  276. VariableInt.Add("scriptCounter", 1);
  277. }

Raw paste data: