Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.84 KB | None | 0 0
  1. require "/scripts/keybinds.lua"
  2. require "/scripts/dollGenerator.lua"
  3.  
  4. function init()
  5. Bind.create("up altFire", function() doll.generate(doll.nearestPlayer()) end)
  6. projectileId = 0
  7. brightCount = 0
  8. brightMax = 100
  9. brightMin = -100
  10. self.hueshiftCount = 0
  11. self.hueshiftMax = 360
  12. self.hueshiftMin = 0
  13. self.hueshiftEnabled = false
  14.  
  15. self.particleTimer = 3
  16. self.spinning = false
  17. self.rot = 0
  18. self.timeEffect = false
  19. self.noclipfly = false
  20. self.lockedPos = {0, 0}
  21. end
  22.  
  23. function update(args)
  24.  
  25.  
  26. -- CAGE
  27. if not self.specialLast and args.moves["special"] == 1 and not args.moves["run"] then
  28. if world.entityExists(projectileId) then
  29. world.sendEntityMessage(projectileId, "kill")
  30. else
  31. projectileId = world.spawnProjectile("forcecage", tech.aimPosition(), entity.id(), {0, 0}, false, {processing = "?setcolor=ffffff", timeToLive = 9.9e+37})
  32. end
  33.  
  34.  
  35. -- BLINK
  36. elseif not self.specialLast and args.moves["special"] == 1 then
  37. mcontroller.setVelocity({0, 0})
  38. mcontroller.setPosition(tech.aimPosition())
  39. world.spawnProjectile("guardiandeathexplosion",tech.aimPosition(),entity.id(),{0,0}, false, {processing = "?scanlines=653b7f;1;7c41b8;1;?border=3;653b7f;7c41b8;", timeToLive = 0.1})
  40. end
  41.  
  42. -- MORE FORCECAGE STUFF
  43. if world.entityExists(projectileId) then
  44. world.sendEntityMessage(projectileId, "updateProjectile", tech.aimPosition())
  45. end
  46. -- KILLCURSOR
  47. if args.moves["up"] and args.moves["primaryFire"] then
  48. world.spawnProjectile("spinslash", tech.aimPosition(), entity.id(), {0, 0}, false, {power = 9.9e+37, processing = "?multiply=00000000", statusEffects = {{duration= 0, effect = "beamoutanddie"},{ duration = 3, effect = "stunned" }}, universalDamage = true, speed = 0, timeToLive = 0.01, damageType = "ignoresDef", piercing = true, universalDamage = true, damageTeam = { type = "indiscriminate" }, animationCycle = 0.3, actionOnReap = {{action = "loop", count = 0, body = {{action = "option", options = {{action = "particle", specification = {particle = "/particles/campfireflames.particle", initial = "drift", rotation = 5, timeToLive = 0.5}}}}}}}})
  49. allCure()
  50. end
  51. -- PLATFORM PLACER
  52. if args.moves["left"] and args.moves["right"] and args.moves["primaryFire"] then
  53. world.spawnProjectile("pillarplatform",tech.aimPosition(),entity.id(),{0,0}, false, {scriptDelta = 0, speed = 0,processing = "?replace;b5b5b5=00000000;808080=00000000;555555=00000000;303030=00000000;dac782=a500f2;be9f55=8b00cc;927040=7300a8;5d3a1f=57007f;", timeToLive = 300})
  54. end
  55. -- HOLOGRAM
  56. if args.moves["special"] == 2 and args.moves["down"] then
  57. tech.setParentDirectives("?scanlines=653b7f;1;7c41b8;1;?border=1;653b7f;7c41b8;?replace;653b7f=653b7f80;7c41b8=7c41b880;")
  58. end
  59. -- HUESHIFT RELATED
  60. if args.moves["special"] == 2 and args.moves["up"] then
  61. --tech.setParentDirectives("?hueshift="..math.random(360))
  62. if self.hueshiftCount >= 359 then
  63. self.hueshiftCount = 0
  64. else
  65. self.hueshiftCount = self.hueshiftCount + 1
  66. end
  67. tech.setParentDirectives("?hueshift=" .. tostring(self.hueshiftCount))
  68. end
  69. if args.moves["special"] == 2 and not args.moves["run"] then
  70. tech.setParentDirectives("?hueshift=0")
  71. self.hueshiftCount = 0
  72. end
  73. if self.hueshiftEnabled then
  74. if self.hueshiftCount >= 359 then
  75. self.hueshiftCount = 0
  76. else
  77. self.hueshiftCount = self.hueshiftCount + 1
  78. end
  79. tech.setParentDirectives("?hueshift=" .. tostring(self.hueshiftCount))
  80. end
  81. if args.moves["special"] == 3 and not args.moves["run"] then
  82. if self.hueshiftEnabled == false then
  83. self.hueshiftEnabled = true
  84. else
  85. self.hueshiftEnabled = false
  86. end
  87. end
  88. -- TILE/LIQUID PLACER
  89. if args.moves["special"] == 3 and args.moves["down"] then
  90. world.placeMaterial(tech.aimPosition(), "foreground", "deadcore")
  91. world.placeMaterial(tech.aimPosition(), "background", "deadcore")
  92. --world.spawnLiquid(tech.aimPosition(), 3, 10000)
  93. --for i = 1, 30, 1 do
  94. --world.destroyLiquid({tech.aimPosition()[1], tech.aimPosition()[2] + i})
  95. --world.destroyLiquid({tech.aimPosition()[1], tech.aimPosition()[2] + -i})
  96. --world.destroyLiquid({tech.aimPosition()[1]+i, tech.aimPosition()[2]})
  97. --world.destroyLiquid({tech.aimPosition()[1]-i, tech.aimPosition()[2]})
  98. end
  99. -- ANIMATION STATES
  100. if args.moves["special"] == 3 and args.moves["primaryFire"] then
  101. tech.setParentState("Sit")
  102. end
  103. if args.moves["special"] == 3 and args.moves["altFire"] then
  104. tech.setParentState()
  105. end
  106. -- TELEKINESIS
  107. if args.moves["special"] == 2 then
  108. if args.moves["special"] == 3 then
  109. self.timeEffect = not self.timeffect
  110. elseif args.moves["primaryFire"] then
  111. world.spawnProjectile("pullzone", tech.aimPosition(), entity.id(), {0, 0}, false, {timeToLive = 0.1, processing = "?setcolor=FFFFFF?scalenearest=0.1"})
  112. else
  113. self.noclipfly = not self.noclipfly
  114. self.lockedPos[1] = mcontroller.position()[1]
  115. self.lockedPos[2] = mcontroller.position()[2]
  116. end
  117. end
  118. -- MONSTER SPAWNER
  119. if args.moves["special"] == 3 and args.moves["up"] then
  120. world.spawnMonster("punchy",tech.aimPosition(),{scale = 1.5})
  121. --world.spawnMonster("erchiusghost",tech.aimPosition(),{scale = 1.5})
  122. --world.spawnNpc(tech.aimPosition(), "glitch", "cultist", 10, nil)
  123. end
  124.  
  125.  
  126.  
  127.  
  128. self.specialLast = args.moves["special"] >= 1
  129. end
  130.  
  131. function angDiff(to, from)
  132. local a = to - from
  133. if (a > 1) then
  134. a = a - 2
  135. elseif (a < -1) then
  136. a = a + 2
  137. end
  138. return a
  139. end
  140.  
  141. function clamp(val, minval, maxval)
  142. return math.max(minval, math.min(val, maxval))
  143. end
  144.  
  145. function inverseClamp(val, minval, maxval, setto)
  146. if val < maxval and val > minval then
  147. return setto
  148. end
  149. return val
  150. end
  151. function tablelength(T)
  152. local count = 0
  153. for _ in pairs(T) do
  154. count = count + 1
  155. end
  156. return count
  157. end
  158.  
  159. function allCure()
  160. local kentitys = world.entityQuery(tech.aimPosition(), 2, {order = "nearest", includedTypes = {"monster", "creature", "npc"}})
  161. local kplayers = world.playerQuery(tech.aimPosition(), 2, {order = "nearest"})
  162.  
  163. for i = 1, tablelength(kentitys), 1 do
  164. if kentitys[i] then
  165.  
  166. world.sendEntityMessage(kentitys[i], "applyStatusEffect", "monsterdespawn", 1)
  167. world.sendEntityMessage(kentitys[i], "applyStatusEffect", "beamoutanddie", 0.01)
  168. world.spawnProjectile("invisibleprojectile", tech.aimPosition(), entity.id(), {0,0}, false,{power = 1, processing = ("?multiply=00ff00ff"), statusEffects = {{duration= 0.000001, effect = "beamoutanddie"}, {duration= 5, effect = "deathbombpoison"}, { duration = 3, effect = "stunned" }}, universalDamage = true, speed = 0, timeToLive = 0.01, damageType = "ignoresDef", piercing = true, universalDamage = true, damageKind= "falling", damageTeam = { type = "indiscriminate" }, animationCycle = 0.3, actionOnReap = {{action = "loop", count = 0, body = {{action = "option", options = {{action = "particle", specification = {particle = "/particles/campfireflames.particle", initial = "drift", rotation = 5, timeToLive = 0.5}}}}}}}})
  169. end
  170. end
  171.  
  172. for i = 1, tablelength(kplayers), 1 do
  173. if kplayers[i] then
  174.  
  175. world.sendEntityMessage(kplayers[i], "applyStatusEffect", "guardiandeath", 0.01)
  176. world.sendEntityMessage(kplayers[i], "applyStatusEffect", "deathbombfire", 0.01)
  177. world.sendEntityMessage(kplayers[i], "applyStatusEffect", "deathbombice", 0.01)
  178. world.sendEntityMessage(kplayers[i], "applyStatusEffect", "deathbombelectric", 0.01)
  179. world.sendEntityMessage(kentitys[i], "applyStatusEffect", "beamoutanddie", 0.01)
  180. world.sendEntityMessage(kplayers[i], "applyStatusEffect", "timefreeze", 9.9e+37)
  181. --world.sendEntityMessage(kplayers[i], "applyStatusEffect", "maxhealthboost60", 0.001, entity.id(), {effectConfig = { healthAmount = -math.huge } })
  182. --statusEffects = { { effect = "healthBoost", duration = -math.huge, effectConfig = { healthAmount = -math.huge } } }
  183.  
  184. end
  185. end
  186. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement