Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(1)
- local p = game.Players.LocalPlayer
- local c = p.Character
- local m = p:GetMouse()
- local cam = workspace.CurrentCamera
- local playerparent = Instance.new("Folder",cam)
- c.Parent = playerparent
- local debris = {}
- local function newbang(pos)
- local part = Instance.new("Part")
- local sound = Instance.new("Sound",part)
- sound.SoundId = "http://www.roblox.com/asset/?id=77170656"
- sound.Playing = true
- sound.PlaybackSpeed = 7
- part.Transparency = 1
- part.Anchored = true
- part.CanCollide = false
- part.CFrame = CFrame.new(pos)
- part.Parent = workspace
- game.Debris:AddItem(part,1.5)
- end
- local function getrandompart()
- local aaa = c:GetChildren()
- local chose = math.random(1,#aaa)
- local bbb = aaa[chose]
- if bbb.ClassName ~= "Part" or bbb.Name == "HumanoidRootPart" then
- bbb = getrandompart()
- end
- return bbb
- end
- local function createdebris(hit,start)
- for i = 1,math.random(1,2) do
- local newdeb
- if hit.ClassName == "Terrain" then
- newdeb = Instance.new("Part")
- else
- newdeb = hit:Clone()
- end
- newdeb.Size = Vector3.new(.4,.4,.4)
- newdeb.Anchored = true
- newdeb.CanCollide = false
- newdeb.Parent = workspace
- newdeb.CFrame = start
- local aa = Instance.new("ObjectValue",newdeb)
- aa.Name = "targ"
- aa.Value = getrandompart()
- local bb = Instance.new("Color3Value",newdeb)
- bb.Name = "colour"
- bb.Value = newdeb.Color
- debris[#debris+1] = newdeb
- local att1 = Instance.new("Attachment",newdeb)
- local att2 = Instance.new("Attachment",newdeb)
- att1.Position = Vector3.new(.2,.2,.2)
- att2.Position = -Vector3.new(.2,.2,.2)
- local lmao = Instance.new("Trail",newdeb)
- lmao.Attachment0 = att1
- lmao.Attachment1 = att2
- lmao.MaxLength = .2
- lmao.FaceCamera = true
- lmao.Name = "t"
- lmao.LightInfluence = 1
- end
- end
- local spawnpoint = Instance.new("SpawnLocation")
- spawnpoint.Size = Vector3.new(2,1,2)
- local function placespawn()
- for i,v in next,debris do
- game.Debris:AddItem(v,2)
- debris[i] = nil
- v.Anchored = false
- v.CanCollide = true
- v.Velocity = Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
- delay(1,function()
- v.CanCollide = false
- spawnpoint.Parent = workspace
- spawnpoint.CFrame = c.Torso.CFrame * CFrame.new(0,-2.5,0)
- end)
- end
- end
- local mousedown = false
- local attackdown = false
- m.Button1Down:connect(function()
- mousedown = true
- end)
- m.Button1Up:connect(function()
- mousedown = false
- end)
- local atkwait = tick()
- game:GetService("RunService").Stepped:connect(function()
- if atkwait > tick() then return end
- atkwait = tick() + .05
- if mousedown then
- if m.Target == nil then return end
- if m.Target.Parent:FindFirstChildOfClass("Humanoid") then
- m.Target.Parent:FindFirstChildOfClass("Humanoid").Health = m.Target.Parent:FindFirstChildOfClass("Humanoid").Health - 30
- m.Target:BreakJoints()
- end
- if m.Target.Parent:IsA("Accessory") then
- m.Target:BreakJoints()
- end
- createdebris(m.Target,m.Hit)
- end
- if attackdown and #debris > 0 then
- local choose = math.random(1,#debris)
- local db = debris[choose]
- if debris[choose] ~= nil then
- table.remove(debris,choose)
- db.CFrame = CFrame.new(m.Hit.p)
- local xp = Instance.new("Explosion")
- xp.Position = db.CFrame.p
- xp.BlastRadius = 3
- xp.BlastPressure = 1
- xp.Visible = false
- xp.Parent = workspace
- db.CanCollide = true
- db.Color = db.colour.Value
- db.t.Color = ColorSequence.new(Color3.new(1,0.1,0.3))
- --delay(.05,function()
- db.Anchored = false
- db.Velocity = Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))*10
- --end)
- delay(1,function()
- db.CanCollide = false
- end)
- newbang(db.targ.Value.CFrame.p)
- end
- end
- end)
- m.KeyDown:connect(function(k)
- if k == "e" then
- for i,v in next,debris do
- game.Debris:AddItem(v,2)
- debris[i] = nil
- v.Anchored = false
- v.CanCollide = true
- v.Velocity = Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
- delay(1,function()
- v.CanCollide = false
- end)
- end
- end
- if k == "t" then
- spawnpoint.Parent = nil
- end
- if k == "r" then
- placespawn()
- end
- if k == "q" then
- c.Torso.CFrame = CFrame.new(m.Hit.p) * CFrame.new(0,3,0)
- end
- if k == "f" then
- attackdown = true
- end
- end)
- m.KeyUp:connect(function(k)
- if k == "f" then
- attackdown = false
- end
- end)
- --[[
- while game:GetService("RunService").Stepped:wait() do
- for i,v in next,c:GetChildren() do
- if v:IsA("Part") then
- if v:FindFirstChildOfClass("Decal") then
- v:FindFirstChildOfClass("Decal"):Destroy()
- end
- v.Transparency = 1
- if #debris > 0 then
- local chosen = math.random(1,#debris)
- local cp = debris[chosen]
- if cp == nil then
- table.remove(debris,chosen)
- else
- local randomrange = CFrame.new(
- math.random(-(v.Size.x*.5)*200,(v.Size.x*.5)*200)/200,
- math.random(-(v.Size.y*.5)*200,(v.Size.y*.5)*200)/200,
- math.random(-(v.Size.z*.5)*200,(v.Size.z*.5)*200)/200
- )
- cp.CFrame = cp.CFrame:lerp(v.CFrame*randomrange,.4)
- end
- end
- elseif v.ClassName ~= "Script" and v.ClassName ~= "LocalScript" and v.ClassName ~= "Humanoid" then
- v:Destroy()
- end
- end
- end
- ]]
- local human = c.Humanoid
- local ff = Instance.new("ForceField",c)
- ff.Visible = false
- human.Died:connect(function()
- for i,v in next,debris do
- game.Debris:AddItem(v,5)
- debris[i] = nil
- v.Anchored = false
- v.CanCollide = true
- v.Velocity = Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
- end
- end)
- game:GetService("RunService").Stepped:connect(function()
- human:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)
- human:SetStateEnabled(Enum.HumanoidStateType.Physics,false)
- human:SetStateEnabled(Enum.HumanoidStateType.FallingDown,false)
- human:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding,false)
- human.PlatformStand = false
- human.MaxHealth = math.huge
- human.Health = math.huge
- for i,v in next,c:GetChildren() do
- if v:IsA("Part") and v.Name ~= "HumanoidRootPart" then
- if v:FindFirstChildOfClass("Decal") then
- v:FindFirstChildOfClass("Decal"):Destroy()
- end
- v.Transparency = 1
- if v.Name == "Head" or v.Name == "Left Arm" or v.Name == "Right Arm" then
- v.BrickColor = BrickColor.new("Bright yellow")
- else
- v.BrickColor = BrickColor.new("Electric blue")
- end
- v.CollisionGroupId = 1
- 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
- v:Destroy()
- end
- end
- for i,cp in next,debris do
- if cp == nil then
- table.remove(debris,i)
- else
- if cp:FindFirstChild("targ") == nil then cp:Destroy() end
- if cp.targ.Value == nil then debris[i] = nil cp.Anchored = false game.Debris:AddItem(cp,1) end
- local v = cp.targ.Value
- local randomrange = CFrame.new(
- math.random(-(v.Size.x*.5)*200,(v.Size.x*.5)*200)/200,
- math.random(-(v.Size.y*.5)*200,(v.Size.y*.5)*200)/200,
- math.random(-(v.Size.z*.5)*200,(v.Size.z*.5)*200)/200
- )
- if v.Name == "Head" then
- randomrange = CFrame.new(
- (math.random(-((v.Size.x+.1)*.5)*200,((v.Size.x+.1)*.5)*200)/200)/2,
- math.random(-((v.Size.y+.1)*.5)*200,((v.Size.y+.1)*.5)*200)/200,
- math.random(-((v.Size.z+.1)*.5)*200,((v.Size.z+.1)*.5)*200)/200
- )
- end
- cp.CFrame = cp.CFrame:lerp(v.CFrame*randomrange,.8)
- local done = false
- for i,v in next,c:GetChildren() do
- if v:IsA("Part") and done == false then
- if (v.Position-cp.Position).magnitude < v.Size.y*.5 then
- cp.Color = v.Color
- done = true
- else
- cp.Color = cp.colour.Value
- end
- end
- end
- cp.t.Color = ColorSequence.new(cp.Color)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement