Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 KB | None | 0 0
  1. local RunService = game:GetService("RunService")
  2. wait(.5)
  3. local part = Instance.new("Part", workspace)
  4. part.Material = Enum.Material.Glass
  5. part.Position = game.Players["Toad_85"].Character.Head.Position + Vector3.new(0,10,0)
  6. part.Color = Color3.fromRGB(0, 0, 255)
  7. part.TopSurface = "Smooth"
  8. part.BottomSurface = "Smooth"
  9. local partpart = Instance.new("ParticleEmitter", part)
  10. partpart.LightEmission = 1
  11. partpart.LightInfluence = 1
  12. partpart.Size = NumberSequence.new (4.54, 0)
  13. partpart.Texture = "http://www.roblox.com/asset/?id=1082139505"
  14. partpart.Size = NumberSequence.new (.9, .9)
  15. partpart.Name="ElectricShock"
  16. partpart.Lifetime = NumberRange.new(.1,.1)
  17. partpart.Rate = 1000
  18. partpart.RotSpeed = NumberRange.new(1000,1000)
  19. partpart.Speed=NumberRange.new(30,30)
  20. partpart.SpreadAngle= Vector2.new(180, 180)
  21. partpart.Enabled = false
  22. local partlight = Instance.new("PointLight", part)
  23. partlight.Brightness = 5.24
  24. partlight.Enabled = false
  25. partlight.Range = 6
  26. partlight.Shadows = true
  27.  
  28. part.Touched:Connect(function(hit)
  29. if hit.Parent ~= workspace and hit.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent:FindFirstChild("Dying") == nil and hit.Parent:FindFirstChildOfClass("Humanoid").Health > 0 then
  30. local a = Instance.new("IntValue", hit.Parent)
  31. a.Name="Dying"
  32. local savedo = part.Orientation
  33. local weld = Instance.new("WeldConstraint")
  34. if part.Anchored == false then
  35. weld.Parent = hit
  36. weld.Part0 = hit
  37. weld.Part1 = part
  38. end
  39. local hum = hit.Parent:FindFirstChild("Humanoid")
  40. hum.WalkSpeed = 0
  41. hum.JumpPower = 0
  42. hum.HipHeight = 0
  43. local light = partlight:Clone()
  44. light.Parent = hit.Parent.Torso
  45. local sound = Instance.new("Sound", script.Parent)
  46. sound.Volume = 4
  47. sound.SoundId = "rbxassetid://165796875"
  48. sound.Parent = hit.Parent.Torso
  49. sound:Play()
  50. local ActiveTracks = hum:GetPlayingAnimationTracks()
  51. for _,v in pairs(ActiveTracks) do
  52. v:Stop()
  53. end
  54. local char = hit.Parent
  55. local bodyparts = char:GetChildren()
  56. for i, bodypart in pairs (bodyparts) do
  57. if bodypart:FindFirstChild("IsElectrocuted") == nil then
  58. local b = Instance.new("IntValue", bodypart)
  59. b.Name="IsElectrocuted"
  60. end
  61. end
  62. for i, bodypart in pairs (bodyparts) do
  63. if bodypart:IsA("BasePart") then
  64. local particle = partpart:Clone()
  65. particle.Name ="toad's trap thing lol"
  66. particle.Parent = bodypart
  67. particle.Enabled = true
  68. partpart.Enabled = true
  69. end
  70. end
  71. local everypart = char:GetDescendants()
  72. for i, part in pairs(everypart) do
  73. if part.ClassName=="Shirt" or part.ClassName=="Pants" or part.ClassName=="ShirtGraphic" or part.ClassName=="Decal" then
  74. part:Destroy()
  75. end
  76. if part:IsA("BasePart") then
  77. part.Color = Color3.fromRGB(0,0,0)
  78. part.Material="Slate"
  79. end
  80. if part:FindFirstChildOfClass("SpecialMesh") then
  81. local mesh = part:FindFirstChildOfClass("SpecialMesh")
  82. mesh.TextureId=""
  83. end
  84. if part.ClassName=="CharacterMesh" then
  85. part.OverlayTextureId = 0
  86. end
  87. end
  88. local joints = char.Torso:GetChildren()
  89. for i, joint in pairs(joints) do
  90. if joint.ClassName=="Motor6D" then
  91. joint.C0 = joint.C0 * CFrame.fromEulerAnglesXYZ(math.random(-50,50)/100,math.random(-50,50)/100,math.random(-50,50)/100)
  92. end
  93. end
  94. for i = 1, 51 do
  95. wait(.001)
  96. if light.Enabled==false then
  97. light.Enabled = true
  98. elseif light.Enabled==true then
  99. light.Enabled = false
  100. end
  101. if char.HumanoidRootPart:FindFirstChild("RootJoint") ~= nil then
  102. 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)
  103. end
  104. for i, joint in pairs(joints) do
  105. if joint.ClassName=="Motor6D" then
  106. joint.C0 = joint.C0 * CFrame.fromEulerAnglesXYZ(math.random(-10,10)/100,math.random(-10,10)/100,math.random(-10,10)/100)
  107. end
  108. end
  109. end
  110. weld:Destroy()
  111. light:Destroy()
  112. hum.PlatformStand = true
  113. part.Orientation = savedo
  114. sound:Destroy()
  115. for i, bodypart in pairs(bodyparts) do
  116. if bodypart:IsA("BasePart") then
  117. partpart.Enabled = false
  118. bodypart:FindFirstChild("toad's trap thing lol").Enabled = false
  119. game.Debris:AddItem(bodypart:FindFirstChild("toad's trap thing lol"), .5)
  120. end
  121. end
  122. wait(.5)
  123. hum.Health = 0
  124. if hit.Parent:FindFirstChild("HumanoidRootPart") then
  125. hit.Parent.HumanoidRootPart.CanCollide = false
  126. end
  127. for i, bodypart in pairs (bodyparts) do
  128. if bodypart:IsA("BasePart") then
  129. RunService.Heartbeat:Wait()
  130. bodypart.Velocity = bodypart.Velocity + Vector3.new(math.random(-50,50),50,math.random(-50,50))
  131. end
  132. end
  133. wait(.25)
  134. a:Destroy()
  135. 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
  136. local a = Instance.new("IntValue", hit)
  137. a.Name="Dying"
  138. if hit:FindFirstChild("IsElectrocuted") == nil then
  139. local b = Instance.new("IntValue", hit)
  140. b.Name="IsElectrocuted"
  141. end
  142. local savedo = part.Orientation
  143. local a1 = Instance.new("Attachment")
  144. local a2 = Instance.new("Attachment")
  145. local r = Instance.new("AlignPosition")
  146. local r2 = Instance.new("AlignOrientation")
  147. local weld = Instance.new("WeldConstraint")
  148. if hit.Parent:FindFirstChild("Humanoid") then
  149. a1.Parent = hit
  150. a2.Parent = part
  151. r.Parent = hit
  152. r2.Parent = hit
  153. a1.Position = Vector3.new(0,0,0)
  154. a1.Name = hit.Name .. " Elec"
  155. a2.WorldPosition = hit.Position
  156. a2.Name = hit.Parent.Name .. " Elec"
  157. a1.WorldOrientation = hit.Orientation
  158. a2.WorldOrientation = hit.Orientation
  159. r.Name = hit.Name .. " AlignPositionElec"
  160. r.Attachment0 = a1
  161. r.Attachment1 = a2
  162. r.Responsiveness = 200
  163. r.RigidityEnabled = false
  164. r2.Name = hit.Name .. " AlignOrientationElec"
  165. r2.Attachment0 = a1
  166. r2.Attachment1 = a2
  167. r2.Responsiveness = 50
  168. r2.RigidityEnabled = true
  169. end
  170. if hit.Parent:FindFirstChild("Humanoid") == nil then
  171. weld.Parent = hit
  172. weld.Part0 = hit
  173. weld.Part1 = part
  174. end
  175. local light = partlight:Clone()
  176. light.Parent = hit
  177. local sound = Instance.new("Sound", script.Parent)
  178. sound.Volume = 4
  179. sound.SoundId = "rbxassetid://165796875"
  180. sound.Parent = hit
  181. sound:Play()
  182. local particle = partpart:Clone()
  183. particle.Parent = hit
  184. particle.Enabled = true
  185. partpart.Enabled = true
  186. if hit:IsA("BasePart") and hit.Material ~= Enum.Material.Ice then
  187. hit.Color = Color3.fromRGB(0,0,0)
  188. hit.Material="Slate"
  189. end
  190. if hit:FindFirstChildOfClass("SpecialMesh") then
  191. local mesh = hit:FindFirstChildOfClass("SpecialMesh")
  192. mesh.TextureId=""
  193. end
  194. if hit.ClassName=="MeshPart" then
  195. hit.TextureID = ""
  196. end
  197. for i = 1, 51 do
  198. wait(.001)
  199. hit.CFrame = hit.CFrame * CFrame.fromEulerAnglesXYZ(math.random(-25,25)/100,math.random(-25,25)/100,math.random(-25,25)/100)
  200. end
  201. a1:Destroy()
  202. a2:Destroy()
  203. r:Destroy()
  204. r2:Destroy()
  205. weld:Destroy()
  206. light.Enabled = false
  207. part.Orientation = savedo
  208. partpart.Enabled = false
  209. particle.Enabled = false
  210. game.Debris:AddItem(particle, .5)
  211. light:Destroy()
  212. sound:Destroy()
  213. part.ElectricShock.Enabled = false
  214. wait(.25)
  215. a:Destroy()
  216. end
  217. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement