Advertisement
Aeyao

Untitled

Jul 1st, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.98 KB | None | 0 0
  1. wait(1)
  2. local p = game.Players.LocalPlayer
  3. local c = p.Character
  4. local m = p:GetMouse()
  5. local cam = workspace.CurrentCamera
  6. local playerparent = Instance.new("Folder",cam)
  7.  
  8. c.Parent = playerparent
  9.  
  10. local debris = {}
  11.  
  12. local function newbang(pos)
  13. local part = Instance.new("Part")
  14. local sound = Instance.new("Sound",part)
  15. sound.SoundId = "http://www.roblox.com/asset/?id=77170656"
  16. sound.Playing = true
  17. sound.PlaybackSpeed = 7
  18. part.Transparency = 1
  19. part.Anchored = true
  20. part.CanCollide = false
  21. part.CFrame = CFrame.new(pos)
  22. part.Parent = workspace
  23. game.Debris:AddItem(part,1.5)
  24. end
  25.  
  26. local function getrandompart()
  27. local aaa = c:GetChildren()
  28. local chose = math.random(1,#aaa)
  29. local bbb = aaa[chose]
  30. if bbb.ClassName ~= "Part" or bbb.Name == "HumanoidRootPart" then
  31. bbb = getrandompart()
  32. end
  33. return bbb
  34. end
  35.  
  36. local function createdebris(hit,start)
  37.  
  38. for i = 1,math.random(1,2) do
  39.  
  40.  
  41. local newdeb
  42. if hit.ClassName == "Terrain" then
  43. newdeb = Instance.new("Part")
  44. else
  45. newdeb = hit:Clone()
  46. end
  47.  
  48.  
  49. newdeb.Size = Vector3.new(.4,.4,.4)
  50. newdeb.Anchored = true
  51. newdeb.CanCollide = false
  52. newdeb.Parent = workspace
  53. newdeb.CFrame = start
  54.  
  55. local aa = Instance.new("ObjectValue",newdeb)
  56. aa.Name = "targ"
  57. aa.Value = getrandompart()
  58.  
  59. local bb = Instance.new("Color3Value",newdeb)
  60. bb.Name = "colour"
  61. bb.Value = newdeb.Color
  62.  
  63. debris[#debris+1] = newdeb
  64.  
  65. local att1 = Instance.new("Attachment",newdeb)
  66. local att2 = Instance.new("Attachment",newdeb)
  67. att1.Position = Vector3.new(.2,.2,.2)
  68. att2.Position = -Vector3.new(.2,.2,.2)
  69.  
  70. local lmao = Instance.new("Trail",newdeb)
  71. lmao.Attachment0 = att1
  72. lmao.Attachment1 = att2
  73. lmao.MaxLength = .2
  74. lmao.FaceCamera = true
  75. lmao.Name = "t"
  76. lmao.LightInfluence = 1
  77. end
  78. end
  79.  
  80. local spawnpoint = Instance.new("SpawnLocation")
  81. spawnpoint.Size = Vector3.new(2,1,2)
  82.  
  83. local function placespawn()
  84. for i,v in next,debris do
  85. game.Debris:AddItem(v,2)
  86. debris[i] = nil
  87. v.Anchored = false
  88. v.CanCollide = true
  89. v.Velocity = Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
  90. delay(1,function()
  91. v.CanCollide = false
  92. spawnpoint.Parent = workspace
  93. spawnpoint.CFrame = c.Torso.CFrame * CFrame.new(0,-2.5,0)
  94. end)
  95. end
  96. end
  97.  
  98. local mousedown = false
  99. local attackdown = false
  100.  
  101. m.Button1Down:connect(function()
  102. mousedown = true
  103. end)
  104.  
  105. m.Button1Up:connect(function()
  106. mousedown = false
  107. end)
  108.  
  109. local atkwait = tick()
  110. game:GetService("RunService").Stepped:connect(function()
  111. if atkwait > tick() then return end
  112. atkwait = tick() + .05
  113. if mousedown then
  114. if m.Target == nil then return end
  115.  
  116. if m.Target.Parent:FindFirstChildOfClass("Humanoid") then
  117. m.Target.Parent:FindFirstChildOfClass("Humanoid").Health = m.Target.Parent:FindFirstChildOfClass("Humanoid").Health - 30
  118. m.Target:BreakJoints()
  119. end
  120.  
  121. if m.Target.Parent:IsA("Accessory") then
  122. m.Target:BreakJoints()
  123. end
  124.  
  125. createdebris(m.Target,m.Hit)
  126. end
  127.  
  128. if attackdown and #debris > 0 then
  129. local choose = math.random(1,#debris)
  130. local db = debris[choose]
  131. if debris[choose] ~= nil then
  132. table.remove(debris,choose)
  133. db.CFrame = CFrame.new(m.Hit.p)
  134.  
  135. local xp = Instance.new("Explosion")
  136. xp.Position = db.CFrame.p
  137. xp.BlastRadius = 3
  138. xp.BlastPressure = 1
  139. xp.Visible = false
  140. xp.Parent = workspace
  141.  
  142. db.CanCollide = true
  143.  
  144. db.Color = db.colour.Value
  145. db.t.Color = ColorSequence.new(Color3.new(1,0.1,0.3))
  146.  
  147. --delay(.05,function()
  148. db.Anchored = false
  149. db.Velocity = Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))*10
  150. --end)
  151.  
  152. delay(1,function()
  153. db.CanCollide = false
  154. end)
  155.  
  156. newbang(db.targ.Value.CFrame.p)
  157.  
  158. end
  159. end
  160.  
  161. end)
  162.  
  163. m.KeyDown:connect(function(k)
  164. if k == "e" then
  165. for i,v in next,debris do
  166. game.Debris:AddItem(v,2)
  167. debris[i] = nil
  168. v.Anchored = false
  169. v.CanCollide = true
  170. v.Velocity = Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
  171. delay(1,function()
  172. v.CanCollide = false
  173. end)
  174. end
  175. end
  176.  
  177. if k == "t" then
  178. spawnpoint.Parent = nil
  179. end
  180.  
  181. if k == "r" then
  182. placespawn()
  183. end
  184.  
  185. if k == "q" then
  186. c.Torso.CFrame = CFrame.new(m.Hit.p) * CFrame.new(0,3,0)
  187. end
  188.  
  189. if k == "f" then
  190. attackdown = true
  191. end
  192. end)
  193.  
  194. m.KeyUp:connect(function(k)
  195. if k == "f" then
  196. attackdown = false
  197. end
  198. end)
  199.  
  200. --[[
  201. while game:GetService("RunService").Stepped:wait() do
  202. for i,v in next,c:GetChildren() do
  203. if v:IsA("Part") then
  204.  
  205. if v:FindFirstChildOfClass("Decal") then
  206. v:FindFirstChildOfClass("Decal"):Destroy()
  207. end
  208. v.Transparency = 1
  209. if #debris > 0 then
  210.  
  211. local chosen = math.random(1,#debris)
  212. local cp = debris[chosen]
  213.  
  214. if cp == nil then
  215. table.remove(debris,chosen)
  216. else
  217.  
  218. local randomrange = CFrame.new(
  219. math.random(-(v.Size.x*.5)*200,(v.Size.x*.5)*200)/200,
  220. math.random(-(v.Size.y*.5)*200,(v.Size.y*.5)*200)/200,
  221. math.random(-(v.Size.z*.5)*200,(v.Size.z*.5)*200)/200
  222. )
  223.  
  224. cp.CFrame = cp.CFrame:lerp(v.CFrame*randomrange,.4)
  225.  
  226. end
  227.  
  228. end
  229. elseif v.ClassName ~= "Script" and v.ClassName ~= "LocalScript" and v.ClassName ~= "Humanoid" then
  230. v:Destroy()
  231. end
  232. end
  233. end
  234. ]]
  235.  
  236. local human = c.Humanoid
  237.  
  238. local ff = Instance.new("ForceField",c)
  239. ff.Visible = false
  240.  
  241. human.Died:connect(function()
  242. for i,v in next,debris do
  243. game.Debris:AddItem(v,5)
  244. debris[i] = nil
  245. v.Anchored = false
  246. v.CanCollide = true
  247. v.Velocity = Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
  248. end
  249. end)
  250.  
  251. game:GetService("RunService").Stepped:connect(function()
  252. human:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)
  253. human:SetStateEnabled(Enum.HumanoidStateType.Physics,false)
  254. human:SetStateEnabled(Enum.HumanoidStateType.FallingDown,false)
  255. human:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding,false)
  256. human.PlatformStand = false
  257. human.MaxHealth = math.huge
  258. human.Health = math.huge
  259.  
  260. for i,v in next,c:GetChildren() do
  261. if v:IsA("Part") and v.Name ~= "HumanoidRootPart" then
  262.  
  263. if v:FindFirstChildOfClass("Decal") then
  264. v:FindFirstChildOfClass("Decal"):Destroy()
  265. end
  266. v.Transparency = 1
  267.  
  268. if v.Name == "Head" or v.Name == "Left Arm" or v.Name == "Right Arm" then
  269. v.BrickColor = BrickColor.new("Bright yellow")
  270. else
  271. v.BrickColor = BrickColor.new("Electric blue")
  272. end
  273.  
  274. v.CollisionGroupId = 1
  275.  
  276. elseif v.ClassName ~= "Script" and v.ClassName ~= "LocalScript" and v.ClassName ~= "Humanoid" and v.ClassName ~= "ForceField" and v.Name ~= "HumanoidRootPart" and v.ClassName ~= "Tool" then
  277. v:Destroy()
  278. end
  279. end
  280.  
  281. for i,cp in next,debris do
  282. if cp == nil then
  283.  
  284. table.remove(debris,i)
  285.  
  286. else
  287. if cp:FindFirstChild("targ") == nil then cp:Destroy() end
  288. if cp.targ.Value == nil then debris[i] = nil cp.Anchored = false game.Debris:AddItem(cp,1) end
  289.  
  290. local v = cp.targ.Value
  291.  
  292. local randomrange = CFrame.new(
  293. math.random(-(v.Size.x*.5)*200,(v.Size.x*.5)*200)/200,
  294. math.random(-(v.Size.y*.5)*200,(v.Size.y*.5)*200)/200,
  295. math.random(-(v.Size.z*.5)*200,(v.Size.z*.5)*200)/200
  296. )
  297.  
  298. if v.Name == "Head" then
  299. randomrange = CFrame.new(
  300. (math.random(-((v.Size.x+.1)*.5)*200,((v.Size.x+.1)*.5)*200)/200)/2,
  301. math.random(-((v.Size.y+.1)*.5)*200,((v.Size.y+.1)*.5)*200)/200,
  302. math.random(-((v.Size.z+.1)*.5)*200,((v.Size.z+.1)*.5)*200)/200
  303. )
  304. end
  305.  
  306. cp.CFrame = cp.CFrame:lerp(v.CFrame*randomrange,.8)
  307.  
  308. local done = false
  309. for i,v in next,c:GetChildren() do
  310. if v:IsA("Part") and done == false then
  311. if (v.Position-cp.Position).magnitude < v.Size.y*.5 then
  312. cp.Color = v.Color
  313. done = true
  314. else
  315. cp.Color = cp.colour.Value
  316. end
  317. end
  318. end
  319. cp.t.Color = ColorSequence.new(cp.Color)
  320.  
  321. end
  322. end
  323.  
  324.  
  325. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement