Advertisement
pz_java

Electricity Gauntlet (Blue)

Sep 14th, 2017
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.53 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. local gauntlet1 = Instance.new("Part",game.Players.LocalPlayer.Character)
  12. local mesh = Instance.new("SpecialMesh",gauntlet1) mesh.MeshId = "rbxassetid://1045626161" mesh.Scale = Vector3.new(1.05,1.05,1.05)
  13. gauntlet1.Size = Vector3.new(0,0,0)
  14. gauntlet1.BrickColor = BrickColor.new("Dark stone grey")
  15. gauntlet1.CanCollide = false
  16. local weld = Instance.new("Weld") weld.Part0 = gauntlet1 weld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
  17. weld.C0 = CFrame.new(0,0.23,0)
  18. weld.Parent = gauntlet1
  19.  
  20. local gauntlet2 = Instance.new("Part",game.Players.LocalPlayer.Character)
  21. local mesh = Instance.new("SpecialMesh",gauntlet2) mesh.MeshId = "rbxassetid://1045638878" mesh.Scale = Vector3.new(1,1,1)
  22. gauntlet2.Size = Vector3.new(0,0,0)
  23. gauntlet2.BrickColor = BrickColor.new("Medium stone grey")
  24. gauntlet2.CanCollide = false
  25. local weld = Instance.new("Weld") weld.Part0 = gauntlet2 weld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
  26. weld.C0 = CFrame.new(0,-0.475,0)*CFrame.Angles(0,math.rad(-90),math.rad(180))
  27. weld.Parent = gauntlet2
  28.  
  29. local gauntlet3 = Instance.new("Part",game.Players.LocalPlayer.Character)
  30. local mesh = Instance.new("SpecialMesh",gauntlet3) mesh.MeshId = "rbxassetid://1045636258" mesh.Scale = Vector3.new(1,1,1)
  31. gauntlet3.Size = Vector3.new(0,0,0)
  32. gauntlet3.BrickColor = BrickColor.new("Medium stone grey")
  33. gauntlet3.CanCollide = false
  34. local weld = Instance.new("Weld") weld.Part0 = gauntlet3 weld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
  35. weld.C0 = CFrame.new(0,-0.3,0)
  36. weld.Parent = gauntlet3
  37.  
  38. local gauntlet4 = Instance.new("Part",game.Players.LocalPlayer.Character)
  39. local mesh = Instance.new("SpecialMesh",gauntlet4) mesh.MeshId = "rbxassetid://1045636258" mesh.Scale = Vector3.new(1,1,1)
  40. gauntlet4.Size = Vector3.new(0,0,0)
  41. gauntlet4.BrickColor = BrickColor.new("Medium stone grey")
  42. gauntlet4.CanCollide = false
  43. local weld = Instance.new("Weld") weld.Part0 = gauntlet4 weld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
  44. weld.C0 = CFrame.new(0,-0.725,0)
  45. weld.Parent = gauntlet4
  46.  
  47.  
  48. local light1 = Instance.new("Part",game.Players.LocalPlayer.Character)
  49. local mesh = Instance.new("SpecialMesh",light1) mesh.MeshType = Enum.MeshType.Sphere
  50. light1.Size = Vector3.new(0.5,0.1,0.5)
  51. light1.Material = Enum.Material.Neon
  52. light1.Color = Color3.fromRGB(125, 230, 255)
  53. light1.CanCollide = false
  54. local weld = Instance.new("Weld") weld.Part0 = light1 weld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
  55. weld.C0 = CFrame.new(-0.25,1.04,0)
  56. weld.Parent = light1
  57. local particle = nil
  58. while particle == nil do
  59. wait()
  60. particle = Instance.new("ParticleEmitter")
  61. particle.Name = "Thunder"
  62. particle.Color = ColorSequence.new(Color3.fromRGB(55, 185, 255))
  63. particle.LightEmission = 1
  64. particle.LightInfluence = 0
  65. particle.Size = NumberSequence.new(2)
  66. particle.Texture = "rbxassetid://1045690145"
  67. particle.ZOffset = 0.5
  68. particle.LockedToPart = true
  69. particle.Enabled = true
  70. particle.Lifetime = NumberRange.new(0.05)
  71. particle.Rate = 10
  72. particle.Rotation = NumberRange.new(-360,360)
  73. particle.Speed = NumberRange.new(1)
  74. particle.SpreadAngle = Vector2.new(999,999)
  75. end
  76.  
  77. electricity = 0
  78.  
  79. charging = false
  80. charging2 = false
  81.  
  82. thunder = false
  83. local thunders = Instance.new("Model",game.Players.LocalPlayer.Character) thunders.Name = "Thunders"
  84. game:GetService("RunService").RenderStepped:connect(function()
  85. if thunder == true then
  86. local pos1 = game.Players.LocalPlayer.Character["Right Arm"].CFrame:toWorldSpace(CFrame.new(0.25,-1.04,0)).p
  87. local pos2 = game.Players.LocalPlayer:GetMouse().Hit.p
  88. if (pos1-pos2).magnitude < 500 then
  89. local cframe = CFrame.new(pos1,pos2)
  90. local val = Instance.new("Vector3Value",thunders) val.Name = "0" val.Value = pos1
  91. for i=1,(pos1-pos2).magnitude/2 do
  92. local val = Instance.new("Vector3Value",thunders) val.Name = tostring(i) val.Value = pos1+cframe.lookVector*i*2 + Vector3.new(math.random(-100,100)/100,math.random(-100,100)/100,math.random(-100,100)/100)
  93. end
  94. for i=1,(pos1-pos2).magnitude/2 do
  95. local thunder = Instance.new("Part",game.Players.LocalPlayer.Character)
  96. thunder.Material = Enum.Material.Neon
  97. thunder.Color = Color3.fromRGB(125, 230, 255)
  98.  
  99. thunder.CanCollide = false
  100. thunder.Anchored = true
  101. thunder.Size = Vector3.new(0.1,0.1,(thunders[i].Value-thunders[i-1].Value).magnitude)
  102.  
  103. thunder.CFrame = CFrame.new((thunders[i].Value+thunders[i-1].Value)/2,thunders[i].Value)
  104. game:GetService("Debris"):AddItem(thunder,0.1)
  105.  
  106. end
  107. for _,v in pairs(thunders:GetChildren()) do
  108. v:remove()
  109. end
  110. local ray = Ray.new(pos1,(pos2-pos1).unit*500)
  111. local hit,position,normal = game.Workspace:FindPartOnRay(ray,game.Players.LocalPlayer.Character)
  112.  
  113. if hit then
  114. if hit.Parent:FindFirstChild("Humanoid") then
  115. hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health-electricity/4
  116. local par = particle:Clone()
  117. par.Parent = hit
  118. part.Rate = 10
  119. end
  120. end
  121. end
  122. end
  123. end)
  124. game:GetService("UserInputService").InputBegan:connect(function(key)
  125. if key.KeyCode == Enum.KeyCode.C then
  126. charging = true
  127. while charging == true do
  128. wait()
  129. if electricity < 350 then
  130. particle:Clone().Parent = game.Players.LocalPlayer.Character["Right Arm"]
  131. electricity = electricity+1
  132. game.Players.LocalPlayer.Character.Humanoid.MaxHealth = game.Players.LocalPlayer.Character.Humanoid.MaxHealth+10
  133. game.Players.LocalPlayer.Character.Humanoid.Health = game.Players.LocalPlayer.Character.Humanoid.Health+10
  134.  
  135.  
  136. end
  137. end
  138. end
  139. if key.KeyCode == Enum.KeyCode.X then
  140. charging2 = true
  141. while charging2 == true do
  142. wait()
  143. if electricity > 0 then
  144. electricity = electricity-1
  145. game.Players.LocalPlayer.Character.Humanoid.MaxHealth = game.Players.LocalPlayer.Character.Humanoid.MaxHealth-10
  146. game.Players.LocalPlayer.Character.Humanoid.Health = game.Players.LocalPlayer.Character.Humanoid.Health-10
  147.  
  148. game.Players.LocalPlayer.Character["Right Arm"].Thunder:remove()
  149. end
  150. end
  151. end
  152. if key.KeyCode == Enum.KeyCode.F then
  153. game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0*CFrame.Angles(0,0,math.rad(90))
  154. thunder = true
  155. end
  156. end)
  157. game:GetService("UserInputService").InputEnded:connect(function(key)
  158. if key.KeyCode == Enum.KeyCode.C then
  159. charging = false
  160. end
  161. if key.KeyCode == Enum.KeyCode.X then
  162. charging2 = false
  163. end
  164. if key.KeyCode == Enum.KeyCode.F then
  165. game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0*CFrame.Angles(0,0,math.rad(-90))
  166. thunder = false
  167. end
  168. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement