Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local partfolder = Instance.new("Folder")
- partfolder.Parent = script
- function bind(char)
- if char then else return end
- local torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
- local hum = char:FindFirstChildOfClass("Humanoid")
- if torso and hum then else return end
- local function break_part(part)
- part.Locked = true
- game:GetService("TweenService"):Create(part,TweenInfo.new(1),{Transparency = 1, Color = Color3.fromRGB(0, 170, 255)}):Play()
- game:GetService("Debris"):AddItem(part,1)
- for i = 1,14 do
- local shard = Instance.new("WedgePart")
- shard.Anchored = false
- shard.CanCollide = false
- shard.Locked = true
- shard.Color = Color3.fromRGB(0, 170, 255)
- shard.Size = Vector3.new(0.05, 0.7, 0.7)
- shard.BrickColor = BrickColor.new("Cyan")
- shard.Material = Enum.Material.Neon
- shard.Parent = partfolder
- game:GetService("TweenService"):Create(shard,TweenInfo.new(math.random(3,5)),{Transparency = 1}):Play()
- game:GetService("Debris"):AddItem(shard,5)
- if i == 1 then
- shard.CFrame = part.CFrame * CFrame.new(math.random(4,6)/14,0,0)
- elseif i == 2 then
- shard.CFrame = part.CFrame * CFrame.new(-math.random(4,6)/14,0,0)
- elseif i == 3 then
- shard.CFrame = part.CFrame * CFrame.new(0,math.random(4,6)/14,0)
- elseif i == 4 then
- shard.CFrame = part.CFrame * CFrame.new(0,-math.random(4,6)/14,0)
- elseif i == 5 then
- shard.CFrame = part.CFrame * CFrame.new(0,0,math.random(4,6)/14)
- elseif i == 6 then
- shard.CFrame = part.CFrame * CFrame.new(0,0,-math.random(4,6)/14)
- elseif i == 7 then
- shard.CFrame = part.CFrame * CFrame.new(math.random(4,6)/14,-math.random(4,6)/14,math.random(4,6)/14)
- elseif i == 8 then
- shard.CFrame = part.CFrame * CFrame.new(-math.random(4,6)/14,-math.random(4,6)/14,math.random(4,6)/14)
- elseif i == 9 then
- shard.CFrame = part.CFrame * CFrame.new(math.random(4,6)/14,-math.random(4,6)/14,-math.random(4,6)/14)
- elseif i == 10 then
- shard.CFrame = part.CFrame * CFrame.new(-math.random(4,6)/14,-math.random(4,6)/14,-math.random(4,6)/14)
- elseif i == 11 then
- shard.CFrame = part.CFrame * CFrame.new(math.random(4,6)/14,math.random(4,6)/14,math.random(4,6)/14)
- elseif i == 12 then
- shard.CFrame = part.CFrame * CFrame.new(-math.random(4,6)/14,math.random(4,6)/14,math.random(4,6)/14)
- elseif i == 13 then
- shard.CFrame = part.CFrame * CFrame.new(math.random(4,6)/14,math.random(4,6)/14,-math.random(4,6)/14)
- elseif i == 14 then
- shard.CFrame = part.CFrame * CFrame.new(-math.random(4,6)/14,math.random(4,6)/14,-math.random(4,6)/14)
- end
- local body = Instance.new("BodyVelocity",shard)
- body.Velocity = (shard.Position-part.Position).Unit * Vector3.new(.5,.5,.5) * math.random(7,10)
- body.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- local angle = Instance.new("BodyAngularVelocity",shard)
- angle.AngularVelocity = Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
- angle.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
- end
- end
- local function ps1(p)
- local particle = Instance.new("ParticleEmitter")
- particle.Parent = p
- particle.Rotation = NumberRange.new(0, 360)
- particle.Color = ColorSequence.new(Color3.new(0.227451, 0.431373, 1),Color3.new(0, 0.666667, 1))
- particle.LightEmission = 2
- particle.Texture = "rbxassetid://268667620"
- particle.Transparency = NumberSequence.new(0,1)
- particle.ZOffset = 2
- particle.Size = NumberSequence.new(0.5, 0)
- particle.Lifetime = NumberRange.new(4, 6)
- particle.Rate = 1000
- particle.RotSpeed = NumberRange.new(0, 360)
- particle.SpreadAngle = Vector2.new(180, 180)
- particle.VelocitySpread = 200
- particle.Speed = NumberRange.new(0, 5)
- particle.Enabled = false
- local m = game:GetService("Players").RespawnTime*10
- for i = 1,m do
- particle:Emit(50/m)
- wait(0.1)
- end
- end
- local function shatter()
- for _,obj in pairs(char:GetDescendants()) do
- if obj:IsA("BasePart") then
- local body = Instance.new("BodyVelocity",obj)
- body.Velocity = Vector3.new(math.random(-10,10)/10,math.random(-10,10)/10,math.random(-10,10)/10) * math.random(2,3)
- body.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- local angle = Instance.new("BodyAngularVelocity",obj)
- angle.AngularVelocity = Vector3.new(math.random(-3,3),math.random(-3,3),math.random(-3,3))
- angle.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
- obj.Anchored = false
- obj.CanCollide = false
- if obj.Parent == char then
- game:GetService("TweenService"):Create(obj,TweenInfo.new(4),{Transparency = 1}):Play()
- --break_part(obj)
- coroutine.wrap(ps1)(obj)
- end
- game:GetService("Debris"):AddItem(obj,5)
- elseif obj:IsA("Texture") or obj:IsA("Decal") or obj:IsA("ParticleEmitter") then
- obj:Destroy()
- end
- end
- end
- local function trans(v,t)
- for _,obj in pairs(char:GetDescendants()) do
- if obj.Name ~= 'HumanoidRootPart' and (obj:IsA("Part") or obj:IsA("UnionOperation") or obj:IsA("BasePart") or obj:IsA("MeshPart") or obj:IsA("Texture") or obj:IsA("Decal")) then
- game:GetService("TweenService"):Create(obj,TweenInfo.new(t),{Transparency = v}):Play()
- end
- end
- end
- local function fx()
- local die = Instance.new("Sound")
- die.SoundId = 'rbxassetid://147729146'
- die.Volume = 5
- die.Parent = torso
- die.TimePosition = 3.8
- die:Play()
- trans(1,0.6)
- wait(0.6)
- trans(0,0.6)
- wait(0.6)
- char:BreakJoints()
- shatter()
- end
- hum.BreakJointsOnDeath = false
- hum.Died:Connect(function()
- hum.BreakJointsOnDeath = false
- fx()
- end)
- end
- for _,v in pairs(workspace:GetChildren()) do
- bind(v)
- end
- workspace.ChildAdded:Connect(bind)
Add Comment
Please, Sign In to add comment