Advertisement
MasonWall19

Untitled

Jun 13th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.15 KB | None | 0 0
  1. local Tool = script.Parent
  2. local Bolt = Tool.Handle
  3.  
  4. local vCharacter
  5. local myTorso
  6. local myHumanoid
  7. local vPlayer
  8.  
  9. Tool.Enabled = true
  10.  
  11. local activateWrathOfGod
  12.  
  13. local debris = game:GetService("Debris")
  14.  
  15. local boltDamage = 300
  16.  
  17. local lightningPart = Instance.new("Part")
  18. lightningPart.Name = "Lightning"
  19. lightningPart.FormFactor = 3
  20. lightningPart.Size = Vector3.new(20, 20, 20)
  21. lightningPart.Anchored = true
  22.  
  23. local lightningMesh = Instance.new("SpecialMesh")
  24. lightningMesh.Scale = Vector3.new(20, 20, 20)
  25. lightningMesh.MeshId = "http://www.roblox.com/asset/?id=65419828"
  26. lightningMesh.TextureId = "http://www.roblox.com/asset/?id=65419395"
  27. lightningMesh.Parent = lightningPart
  28.  
  29. function tagHumanoid(humanoid, player)
  30. if humanoid ~= nil then
  31. creator = Instance.new("ObjectValue")
  32. creator.Name = "creator"
  33. creator.Value = player
  34. creator.Parent = humanoid
  35. debris:AddItem(creator, 1)
  36. end
  37. end
  38.  
  39. function blow(parent, dmg, hit)
  40. if parent then
  41. if hit.Parent then
  42. humanoid = hit.Parent:FindFirstChild("Humanoid")
  43. end
  44. vCharacter = Tool.Parent
  45. myHumanoid = vCharacter:FindFirstChild("Humanoid")
  46. vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
  47. if humanoid ~= nil and myHumanoid ~= humanoid and myHumanoid ~= nil then
  48. tagHumanoid(humanoid, vPlayer)
  49. humanoid:TakeDamage(dmg)
  50. if dmg > 30 then humanoid.Sit = true end
  51. if humanoid.WalkSpeed >= 16.0 then
  52. humanoid.WalkSpeed = 9.0
  53. coroutine.resume(coroutine.create(function()
  54. wait(.001)
  55. if humanoid then humanoid.WalkSpeed = 16.0 end
  56. end))
  57. end
  58. end
  59. end
  60. end
  61.  
  62. while Tool:FindFirstChild("WrathOfGod") == nil do
  63. wait()
  64. end
  65. activateWrathOfGod = Tool.WrathOfGod
  66. activateWrathOfGod.Changed:connect(function()
  67. if activateWrathOfGod and activateWrathOfGod.Value == true then
  68. -- Activate the powar!
  69. local tempHeads = {}
  70. local players = game.Players:GetChildren()
  71. for i = 1, #players do
  72. if players[i] and players[i] ~= vPlayer and players[i].Character and players[i].Character:FindFirstChild("Torso") and players[i].Character:FindFirstChild("Humanoid") then -- and players[i] ~= vPlayer
  73. local head = players[i].Character:FindFirstChild("Head")
  74. if head and (head.Position - myTorso.Position).magnitude < 80 then
  75. tempHeads[head] = head
  76. end
  77. end
  78. end
  79.  
  80. for i, head in pairs(tempHeads) do
  81. tick()
  82. local lPart = lightningPart:Clone()
  83. local spawnPos = head.Position + Vector3.new(math.random(), 40, math.random())
  84. lPart.Size = Vector3.new(2, 2, (spawnPos - head.Position).magnitude + 1)
  85. local tempCFrame = CFrame.new(spawnPos, head.Position)
  86. lPart.CFrame = tempCFrame + tempCFrame:vectorToWorldSpace(Vector3.new(1, 1, 1) - lPart.Size/2.0)
  87. lPart.Mesh.Scale = Vector3.new(1, 1, lPart.Size.Z * 1/14)
  88. lPart.Parent = game.Workspace
  89. blow(head, 80, head)
  90. debris:AddItem(lPart, 0.75)
  91. end
  92. tempHeads = {}
  93. wait(.001)
  94. activateWrathOfGod.Value = false
  95. end
  96. end)
  97.  
  98.  
  99.  
  100. function summonBoltShield()
  101. vCharacter = Tool.Parent
  102. vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
  103. if vCharacter == nil or vPlayer == nil then
  104. return
  105. end
  106.  
  107. for i = 1, 16 do
  108. local pos = CFrame.Angles(0, i * math.pi/8, 0) * myTorso.CFrame.lookVector
  109.  
  110. local spawnPos = myTorso.Position
  111. spawnPos = spawnPos + (pos * 4.25)
  112.  
  113. lightningProjectile = lightningPart:Clone()
  114. lightningProjectile.Name = "rope"
  115. lightningProjectile.CFrame = CFrame.new(spawnPos, spawnPos + pos) * CFrame.Angles(-math.pi/2, 0, 0)
  116. local floatForce = Instance.new("BodyForce")
  117. floatForce.force = Vector3.new(0, lightningPart:GetMass() * 196.1, 0)
  118. floatForce.Parent = lightningProjectile
  119. lightningProjectile.Velocity = pos * 75.0
  120. lightningProjectile.Parent = game.Workspace
  121. lightningProjectile.Touched:connect(function(hit) blow(lightningProjectile, boltDamage, hit) end)
  122. debris:addItem(lightningProjectile, 4)
  123. end
  124. end
  125.  
  126. function shootBolts()
  127. vCharacter = Tool.Parent
  128. vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
  129. if vCharacter == nil or vPlayer == nil then
  130. return
  131. end
  132.  
  133. for i = 1, 16 do
  134. local pos = CFrame.Angles(0, i * math.pi/8, 0) * myTorso.CFrame.lookVector
  135.  
  136. local spawnPos = myTorso.Position
  137. spawnPos = spawnPos + (pos * 5.0)
  138.  
  139. lightningProjectile = lightningPart:Clone()
  140. lightningProjectile.Name = "rope"
  141. lightningProjectile.CFrame = CFrame.new(spawnPos, spawnPos + pos) --* CFrame.Angles(-math.pi/2, 0, 0)
  142. lightningProjectile.Anchored = false
  143. lightningProjectile.CanCollide = false
  144.  
  145. lightningProjectile.Size = Vector3.new(1, 1, 4)
  146.  
  147. if lightningProjectile:FindFirstChild("Mesh") then lightningProjectile.Mesh.Scale = lightningProjectile.Mesh.Scale * 0.75 end
  148.  
  149. local floatForce = Instance.new("BodyForce")
  150. floatForce.force = Vector3.new(0, lightningProjectile:GetMass() * 196.1, 0)
  151. floatForce.Parent = lightningProjectile
  152. lightningProjectile.Velocity = pos * 50.0
  153. lightningProjectile.Parent = game.Workspace
  154. lightningProjectile.Touched:connect(function(hit) blow(lightningProjectile, boltDamage, hit) end)
  155. debris:addItem(lightningProjectile, 4)
  156. end
  157. end
  158.  
  159. function boltUp()
  160. Tool.GripForward = Vector3.new(0, 1, 0)
  161. Tool.GripRight = Vector3.new(1, 0, 0)
  162. Tool.GripUp = Vector3.new(0, 0, 1)
  163. end
  164.  
  165. function boltDown()
  166. Tool.GripForward = Vector3.new(0, 0.848, 0.53)
  167. Tool.GripRight = Vector3.new(1, 0, 0)
  168. Tool.GripUp = Vector3.new(0, -0.53, 0.848)
  169. end
  170.  
  171. function onActivated()
  172. if Tool.Enabled == false then
  173. return
  174. end
  175.  
  176. if myTorso == nil or myHumanoid == nil then
  177. return
  178. end
  179.  
  180. Tool.Enabled = false
  181. tick()
  182.  
  183. boltDown()
  184.  
  185. wait(0.25)
  186.  
  187. if math.random() < 0.4 then
  188. summonBoltShield()
  189. else
  190. shootBolts()
  191. end
  192.  
  193. wait(0.5)
  194. boltUp()
  195.  
  196. wait(.001)
  197. Tool.Enabled = true
  198. end
  199.  
  200. function onEquipped()
  201. vCharacter = Tool.Parent
  202. myTorso = vCharacter:FindFirstChild("Torso")
  203. myHumanoid = vCharacter:FindFirstChild("Humanoid")
  204. vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
  205. end
  206.  
  207. function onUnequipped()
  208. end
  209.  
  210. Tool.Activated:connect(onActivated)
  211. Tool.Equipped:connect(onEquipped)
  212. Tool.Unequipped:connect(onUnequipped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement