Advertisement
pz_java

Electricity Gauntlet (Yellow)

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