Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.50 KB | None | 0 0
  1. local RunService = game:GetService("RunService")
  2. wait(1)
  3. local part = Instance.new("Part", workspace)
  4. part.Position = game.Players.LocalPlayer.Character.Head.Position + Vector3.new(0,10,0)
  5. part.Touched:Connect(function(hit)
  6. if hit.Parent ~= workspace and hit.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent:FindFirstChild("Dying") == nil and hit.Parent:FindFirstChildOfClass("Humanoid").Health > 0 then
  7. local a = Instance.new("IntValue", hit.Parent)
  8. a.Name="Dying"
  9. local savedo = part.Orientation
  10. local weld = Instance.new("WeldConstraint")
  11. if part.Anchored == false then
  12. weld.Parent = hit
  13. weld.Part0 = hit
  14. weld.Part1 = part
  15. end
  16. local hum = hit.Parent:FindFirstChild("Humanoid")
  17. hum.WalkSpeed = 0
  18. hum.JumpPower = 0
  19. hum.HipHeight = 0
  20. local sound = Instance.new("Sound", script.Parent)
  21. sound.Volume = 4
  22. sound.SoundId = "rbxassetid://165796875"
  23. sound.Parent = hit.Parent.Torso
  24. sound:Play()
  25. local ActiveTracks = hum:GetPlayingAnimationTracks()
  26. for _,v in pairs(ActiveTracks) do
  27. v:Stop()
  28. end
  29. local char = hit.Parent
  30. local bodyparts = char:GetChildren()
  31. for i, bodypart in pairs (bodyparts) do
  32. if bodypart:FindFirstChild("IsElectrocuted") == nil then
  33. local b = Instance.new("IntValue", bodypart)
  34. b.Name="IsElectrocuted"
  35. end
  36. end
  37. local everypart = char:GetDescendants()
  38. for i, part in pairs(everypart) do
  39. if part.ClassName=="Shirt" or part.ClassName=="Pants" or part.ClassName=="ShirtGraphic" or part.ClassName=="Decal" then
  40. part:Destroy()
  41. end
  42. if part:IsA("BasePart") then
  43. part.Color = Color3.fromRGB(0,0,0)
  44. part.Material="Slate"
  45. end
  46. if part:FindFirstChildOfClass("SpecialMesh") then
  47. local mesh = part:FindFirstChildOfClass("SpecialMesh")
  48. mesh.TextureId=""
  49. end
  50. if part.ClassName=="CharacterMesh" then
  51. part.OverlayTextureId = 0
  52. end
  53. end
  54. local joints = char.Torso:GetChildren()
  55. for i, joint in pairs(joints) do
  56. if joint.ClassName=="Motor6D" then
  57. joint.C0 = joint.C0 * CFrame.fromEulerAnglesXYZ(math.random(-50,50)/100,math.random(-50,50)/100,math.random(-50,50)/100)
  58. end
  59. end
  60. for i = 1, 51 do
  61. wait(.001)
  62. if char.HumanoidRootPart:FindFirstChild("RootJoint") ~= nil then
  63. char.HumanoidRootPart.RootJoint.C0 = char.Torso.Neck.C0 * CFrame.fromEulerAnglesXYZ(math.random(-25,25)/100,math.random(-25,25)/100,math.random(-25,25)/100)
  64. end
  65. for i, joint in pairs(joints) do
  66. if joint.ClassName=="Motor6D" then
  67. joint.C0 = joint.C0 * CFrame.fromEulerAnglesXYZ(math.random(-10,10)/100,math.random(-10,10)/100,math.random(-10,10)/100)
  68. end
  69. end
  70. end
  71. weld:Destroy()
  72. hum.PlatformStand = true
  73. part.Orientation = savedo
  74. sound:Destroy()
  75. wait(.5)
  76. hum.Health = 0
  77. if hit.Parent:FindFirstChild("HumanoidRootPart") then
  78. hit.Parent.HumanoidRootPart.CanCollide = false
  79. end
  80. for i, bodypart in pairs (bodyparts) do
  81. if bodypart:IsA("BasePart") then
  82. RunService.Heartbeat:Wait()
  83. bodypart.Velocity = bodypart.Velocity + Vector3.new(math.random(-50,50),50,math.random(-50,50))
  84. end
  85. end
  86. wait(.25)
  87. a:Destroy()
  88. elseif hit:FindFirstChild("Dying") == nil and hit.Anchored == false and hit.Name~="HumanoidRootPart" and (hit.CanCollide == true and hit.Transparency ~= 1) and hit:FindFirstChild("IsElectrocuted") == nil and (hit.Material == Enum.Material.Metal or hit.Material == Enum.Material.CorrodedMetal or hit.Material == Enum.Material.Foil or hit.Material == Enum.Material.Grass or hit.Material == Enum.Material.Ice) then
  89. local a = Instance.new("IntValue", hit)
  90. a.Name="Dying"
  91. if hit:FindFirstChild("IsElectrocuted") == nil then
  92. local b = Instance.new("IntValue", hit)
  93. b.Name="IsElectrocuted"
  94. end
  95. local savedo = part.Orientation
  96. local a1 = Instance.new("Attachment")
  97. local a2 = Instance.new("Attachment")
  98. local r = Instance.new("AlignPosition")
  99. local r2 = Instance.new("AlignOrientation")
  100. local weld = Instance.new("WeldConstraint")
  101. if hit.Parent:FindFirstChild("Humanoid") then
  102. a1.Parent = hit
  103. a2.Parent = part
  104. r.Parent = hit
  105. r2.Parent = hit
  106. a1.Position = Vector3.new(0,0,0)
  107. a1.Name = hit.Name .. " Elec"
  108. a2.WorldPosition = hit.Position
  109. a2.Name = hit.Parent.Name .. " Elec"
  110. a1.WorldOrientation = hit.Orientation
  111. a2.WorldOrientation = hit.Orientation
  112. r.Name = hit.Name .. " AlignPositionElec"
  113. r.Attachment0 = a1
  114. r.Attachment1 = a2
  115. r.Responsiveness = 200
  116. r.RigidityEnabled = false
  117. r2.Name = hit.Name .. " AlignOrientationElec"
  118. r2.Attachment0 = a1
  119. r2.Attachment1 = a2
  120. r2.Responsiveness = 50
  121. r2.RigidityEnabled = true
  122. end
  123. if hit.Parent:FindFirstChild("Humanoid") == nil then
  124. weld.Parent = hit
  125. weld.Part0 = hit
  126. weld.Part1 = part
  127. end
  128. local sound = part.Shock:Clone()
  129. sound.Parent = hit
  130. sound:Play()
  131. if hit:IsA("BasePart") and hit.Material ~= Enum.Material.Ice then
  132. hit.Color = Color3.fromRGB(0,0,0)
  133. hit.Material="Slate"
  134. end
  135. if hit:FindFirstChildOfClass("SpecialMesh") then
  136. local mesh = hit:FindFirstChildOfClass("SpecialMesh")
  137. mesh.TextureId=""
  138. end
  139. if hit.ClassName=="MeshPart" then
  140. hit.TextureID = ""
  141. end
  142. for i = 1, 51 do
  143. wait(.001)
  144. hit.CFrame = hit.CFrame * CFrame.fromEulerAnglesXYZ(math.random(-25,25)/100,math.random(-25,25)/100,math.random(-25,25)/100)
  145. end
  146. a1:Destroy()
  147. a2:Destroy()
  148. r:Destroy()
  149. r2:Destroy()
  150. weld:Destroy()
  151. part.Orientation = savedo
  152. sound:Destroy()
  153. part.ElectricShock.Enabled = false
  154. wait(.25)
  155. a:Destroy()
  156. end
  157. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement