Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- function DescendantAdded(item)
- if item:IsA("Explosion") then
- item.Hit:Connect(function(hit)
- local c = hit:FindFirstChild("confirm")
- if c and c:IsA("BoolValue") then
- c.Value = true
- end
- end)
- end
- end
- workspace.DescendantAdded:Connect(DescendantAdded)
- function effect(p,wt)
- local ParticleEmitter1 = Instance.new("ParticleEmitter")
- local ParticleEmitter2 = Instance.new("ParticleEmitter")
- local ParticleEmitter3 = Instance.new("ParticleEmitter")
- local ParticleEmitter4 = Instance.new("ParticleEmitter")
- local ParticleEmitter5 = Instance.new("ParticleEmitter")
- local ParticleEmitter6 = Instance.new("ParticleEmitter")
- local ParticleEmitter7 = Instance.new("ParticleEmitter")
- ParticleEmitter1.Name = "boom"
- ParticleEmitter1.Parent = p
- ParticleEmitter1.Speed = NumberRange.new(12, 17)
- ParticleEmitter1.Enabled = false
- ParticleEmitter1.LightInfluence = 1
- ParticleEmitter1.Texture = "rbxassetid://3607612429"
- ParticleEmitter1.Lifetime = NumberRange.new(0.5, 1.5)
- ParticleEmitter1.Rate = 500
- ParticleEmitter1.SpreadAngle = Vector2.new(90, 90)
- ParticleEmitter1.VelocitySpread = 90
- ParticleEmitter2.Name = "boom"
- ParticleEmitter2.Parent = p
- ParticleEmitter2.Speed = NumberRange.new(12, 17)
- ParticleEmitter2.Enabled = false
- ParticleEmitter2.LightInfluence = 1
- ParticleEmitter2.Texture = "rbxassetid://3607612660"
- ParticleEmitter2.Lifetime = NumberRange.new(0.5, 1.5)
- ParticleEmitter2.Rate = 500
- ParticleEmitter2.SpreadAngle = Vector2.new(90, 90)
- ParticleEmitter2.VelocitySpread = 90
- ParticleEmitter3.Name = "boom"
- ParticleEmitter3.Parent = p
- ParticleEmitter3.Speed = NumberRange.new(12, 17)
- ParticleEmitter3.Enabled = false
- ParticleEmitter3.LightInfluence = 1
- ParticleEmitter3.Texture = "rbxassetid://3607613049"
- ParticleEmitter3.Lifetime = NumberRange.new(0.5, 1.5)
- ParticleEmitter3.Rate = 500
- ParticleEmitter3.SpreadAngle = Vector2.new(90, 90)
- ParticleEmitter3.VelocitySpread = 90
- ParticleEmitter4.Name = "boom"
- ParticleEmitter4.Parent = p
- ParticleEmitter4.Speed = NumberRange.new(12, 17)
- ParticleEmitter4.Enabled = false
- ParticleEmitter4.LightInfluence = 1
- ParticleEmitter4.Texture = "rbxassetid://3607612871"
- ParticleEmitter4.Lifetime = NumberRange.new(0.5, 1.5)
- ParticleEmitter4.Rate = 500
- ParticleEmitter4.SpreadAngle = Vector2.new(90, 90)
- ParticleEmitter4.VelocitySpread = 90
- ParticleEmitter5.Name = "ex10"
- ParticleEmitter5.Parent = p
- ParticleEmitter5.Speed = NumberRange.new(12, 15)
- ParticleEmitter5.Enabled = false
- ParticleEmitter5.LightInfluence = 1
- ParticleEmitter5.Texture = "rbxassetid://3607568189"
- ParticleEmitter5.Size = NumberSequence.new(2,2)
- ParticleEmitter5.Lifetime = NumberRange.new(0.5, 1)
- ParticleEmitter5.Rate = 100
- ParticleEmitter5.RotSpeed = NumberRange.new(160, 160)
- ParticleEmitter5.SpreadAngle = Vector2.new(90, 90)
- ParticleEmitter5.VelocitySpread = 90
- ParticleEmitter6.Name = "ex12"
- ParticleEmitter6.Parent = p
- ParticleEmitter6.Speed = NumberRange.new(12, 15)
- ParticleEmitter6.Enabled = false
- ParticleEmitter6.LightInfluence = 1
- ParticleEmitter6.Texture = "rbxassetid://3607567959"
- ParticleEmitter6.Size = NumberSequence.new(2,2)
- ParticleEmitter6.Lifetime = NumberRange.new(0.5, 1)
- ParticleEmitter6.Rate = 100
- ParticleEmitter6.RotSpeed = NumberRange.new(160, 160)
- ParticleEmitter6.SpreadAngle = Vector2.new(90, 90)
- ParticleEmitter6.VelocitySpread = 90
- ParticleEmitter7.Name = "ex9"
- ParticleEmitter7.Parent = p
- ParticleEmitter7.Speed = NumberRange.new(12, 15)
- ParticleEmitter7.Enabled = false
- ParticleEmitter7.LightInfluence = 1
- ParticleEmitter7.Texture = "rbxassetid://3607568450"
- ParticleEmitter7.Size = NumberSequence.new(2,2)
- ParticleEmitter7.Lifetime = NumberRange.new(0.5, 1)
- ParticleEmitter7.Rate = 100
- ParticleEmitter7.RotSpeed = NumberRange.new(160, 160)
- ParticleEmitter7.SpreadAngle = Vector2.new(90, 90)
- ParticleEmitter7.VelocitySpread = 90
- spawn(function()
- ParticleEmitter1.Enabled = true
- ParticleEmitter2.Enabled = true
- ParticleEmitter3.Enabled = true
- ParticleEmitter4.Enabled = true
- ParticleEmitter5.Enabled = true
- ParticleEmitter6.Enabled = true
- ParticleEmitter7.Enabled = true
- wait(wt) -- crappy coded here but idc lol
- ParticleEmitter1.Enabled = false
- ParticleEmitter2.Enabled = false
- ParticleEmitter3.Enabled = false
- ParticleEmitter4.Enabled = false
- ParticleEmitter5.Enabled = false
- ParticleEmitter6.Enabled = false
- ParticleEmitter7.Enabled = false
- end)
- end
- function igniteall(p1,p2,p3)
- local function rip(p1,p2,mode,p3,manual)
- spawn(function()
- local boomcollide = nil
- if mode == 1 then
- p1.BrickColor = BrickColor.new("Institutional white")
- wait(.25)
- elseif mode == 2 then
- end
- local ex = Instance.new("Explosion",workspace)
- ex.Position = p1.Position
- ex.BlastRadius = 15
- ex.BlastPressure = 1000000
- ex.DestroyJointRadiusPercent = 100
- ex.ExplosionType = "CratersAndDebris"
- ex.Hit:connect(function(Part, Distance)
- if Distance <= 15 and Part.Name ~= "tnt block" and Part.Name ~= "tnt dust" and Part.Parent.Name ~= "tnt dust" then
- Part.Anchored = false
- Part:BreakJoints()
- elseif Part.Name == "tnt block" and not Part:FindFirstChild("exploded") and not Part then
- Part.Anchored = false
- local done = Instance.new("NumberValue",Part)
- done.Name = "exploded"
- Part.Anchored = false
- rip(Part,Part:FindFirstChild("ClickDetector"),1,nil,false)
- end
- end)
- --decals.Transparency = 0
- local dust = Instance.new("Part",workspace)
- dust.Name = "tnt dust"
- dust.Anchored = true
- dust.CanCollide = false
- dust.Transparency = 1
- dust.CFrame = p1.CFrame - Vector3.new(0,2,0)
- dust.Size = Vector3.new(10,0.05,10)
- local decal = Instance.new("Decal",dust)
- decal.Name = "tnt dust"
- decal.Texture = "rbxassetid://2963636012"
- decal.Transparency = 0
- decal.Face = "Top"
- p2.Parent = dust
- if mode == 1 then
- local boomcollide = Instance.new("Sound",dust)
- boomcollide.Volume = 2
- boomcollide.Looped = false
- boomcollide.SoundId = "rbxassetid://301924340"
- boomcollide:Play()
- boomcollide.TimePosition = 3.25
- end
- spawn(function()
- if p3 ~= nil then
- p3.Parent = dust
- end
- end)
- effect(dust,.1)
- p1:Destroy()
- spawn(function()
- local Info = TweenInfo.new(4,Enum.EasingStyle.Linear)
- local tween = TweenService:Create(decal,Info,{Transparency = 1})
- tween:Play()
- wait(4)
- dust:Destroy()
- end)
- end)
- end
- spawn(function()
- if p3 == nil then
- p1.BrickColor = BrickColor.new("Institutional white")
- wait(.25)
- else
- for i,v in pairs(p1:GetChildren()) do
- if v:IsA("Decal") then
- spawn(function()
- while p1 ~= nil do
- p1.BrickColor = BrickColor.new("Institutional white")
- v.Transparency = 1
- wait(.4)
- p1.BrickColor = BrickColor.new("Really red")
- v.Transparency = 0
- wait(.4)
- end
- end)
- end
- end
- end
- local ex = Instance.new("Explosion",workspace)
- ex.Position = p1.Position
- ex.BlastRadius = 15
- ex.BlastPressure = 1000000
- ex.DestroyJointRadiusPercent = 100
- ex.ExplosionType = "CratersAndDebris"
- ex.Hit:connect(function(Part, Distance)
- if Distance <= 15 and Part.Name ~= "tnt block" and Part.Name ~= "tnt dust" and Part.Parent.Name ~= "tnt dust" then
- Part.Anchored = false
- Part:BreakJoints()
- elseif Part.Name == "tnt block" and not Part:FindFirstChild("exploded") and not Part then
- Part.Anchored = false
- local done = Instance.new("NumberValue",Part)
- done.Name = "exploded"
- Part.Anchored = false
- rip(Part,Part:FindFirstChild("ClickDetector"),1,nil,false)
- end
- end)
- --decals.Transparency = 0
- local dust = Instance.new("Part",workspace)
- dust.Name = "tnt dust"
- dust.Anchored = true
- dust.CanCollide = false
- dust.Transparency = 1
- dust.CFrame = p1.CFrame - Vector3.new(0,2,0)
- dust.Size = Vector3.new(10,0.05,10)
- local decal = Instance.new("Decal",dust)
- decal.Name = "tnt dust"
- decal.Texture = "rbxassetid://2963636012"
- decal.Transparency = 0
- decal.Face = "Top"
- p2.Parent = dust
- local boomcollide = Instance.new("Sound",dust)
- boomcollide.Volume = 2
- boomcollide.Looped = false
- boomcollide.SoundId = "rbxassetid://301924340"
- boomcollide:Play()
- boomcollide.TimePosition = 3.25
- spawn(function()
- if p3 ~= nil then
- p3.Parent = dust
- end
- end)
- effect(dust,.1)
- p1:Destroy()
- spawn(function()
- local Info = TweenInfo.new(4,Enum.EasingStyle.Linear)
- local tween = TweenService:Create(decal,Info,{Transparency = 1})
- tween:Play()
- wait(4)
- dust:Destroy()
- end)
- end)
- end
- function createtnt(m)
- local P = Vector3.new(math.floor(m.X/4)*4 + 2,math.floor(m.Y/4)*4 + 2,math.floor(m.Z/4)*4 + 2)
- local overlap = false
- local D = workspace:GetDescendants()
- for i = 1,#D do
- if D[i]:IsA("BasePart") and D[i].Name == "tnt block" and D[i].Position.X == P.X and D[i].Position.Y == P.Y and D[i].Position.Z == P.Z then
- overlap = true
- end
- end
- if overlap then return end
- local exploding = false
- local part = Instance.new("Part",workspace)
- part.Name = "tnt block"
- part.Position = P
- part.BrickColor = BrickColor.new("Really red")
- part.CastShadow = true
- part.Material = Enum.Material.Neon
- part.Size = Vector3.new(4,4,4)
- part.Anchored = true
- part.CanCollide = true
- part.Massless = true
- local confirm = Instance.new("BoolValue",part)
- confirm.Name = "confirm"
- local p = Instance.new("ClickDetector",part)
- p.MaxActivationDistance = 10
- p.CursorIcon = "rbxassetid://93681360"
- local Decal0 = Instance.new("Decal")
- local Decal1 = Instance.new("Decal")
- local Decal2 = Instance.new("Decal")
- local Decal3 = Instance.new("Decal")
- local Decal4 = Instance.new("Decal")
- local Decal5 = Instance.new("Decal")
- Decal0.Parent = part
- Decal0.Texture = "http://www.roblox.com/asset/?id=48005067"
- Decal1.Parent = part
- Decal1.Texture = "http://www.roblox.com/asset/?id=48005064"
- Decal1.Face = Enum.NormalId.Bottom
- Decal2.Parent = part
- Decal2.Texture = "http://www.roblox.com/asset/?id=48005067"
- Decal2.Face = Enum.NormalId.Back
- Decal3.Parent = part
- Decal3.Texture = "http://www.roblox.com/asset/?id=48005073"
- Decal3.Face = Enum.NormalId.Top
- Decal4.Parent = part
- Decal4.Texture = "http://www.roblox.com/asset/?id=48005067"
- Decal4.Face = Enum.NormalId.Left
- Decal5.Parent = part
- Decal5.Texture = "http://www.roblox.com/asset/?id=48005067"
- Decal5.Face = Enum.NormalId.Right
- local function explode()
- local boom = Instance.new("Sound",part)
- boom.Volume = 2
- boom.Looped = false
- boom.SoundId = "rbxassetid://301924340"
- boom:Play()
- part.Anchored = false
- part.CanCollide = true
- part.CFrame = part.CFrame + Vector3.new(0,1,0)
- p.MaxActivationDistance = 0
- local decals = nil
- for i,v in pairs(part:GetChildren()) do
- if v:IsA("Decal") then
- spawn(function()
- decals = v
- --[[local Info = TweenInfo.new(3,Enum.EasingStyle.Linear)
- local tween = TweenService:Create(v,Info,{Transparency = .5})
- tween:Play()]]
- while part ~= nil do
- part.BrickColor = BrickColor.new("Institutional white")
- v.Transparency = 1
- wait(.4)
- part.BrickColor = BrickColor.new("Really red")
- v.Transparency = 0
- wait(.4)
- end
- end)
- end
- end
- wait(3)
- local function rip(p1,p2,mode,p3,manual)
- spawn(function()
- if mode == 1 then
- p1.BrickColor = BrickColor.new("Institutional white")
- wait(.25)
- elseif mode == 2 then
- end
- local ex = Instance.new("Explosion",workspace)
- ex.Position = p1.Position
- ex.BlastRadius = 15
- ex.BlastPressure = 1000000
- ex.DestroyJointRadiusPercent = 100
- ex.ExplosionType = "CratersAndDebris"
- ex.Hit:connect(function(Part, Distance)
- if Distance <= 15 and Part.Name ~= "tnt block" and Part.Name ~= "tnt dust" and Part.Parent.Name ~= "tnt dust" then
- Part.Anchored = false
- Part:BreakJoints()
- elseif Part.Name == "tnt block" and not Part:FindFirstChild("exploded") and not Part then
- Part.Anchored = false
- local done = Instance.new("NumberValue",Part)
- done.Name = "exploded"
- Part.Anchored = false
- rip(Part,Part:FindFirstChild("ClickDetector"),1,nil,false)
- end
- end)
- --decals.Transparency = 0
- local dust = Instance.new("Part",workspace)
- dust.Name = "tnt dust"
- dust.Anchored = true
- dust.CanCollide = false
- dust.Transparency = 1
- dust.CFrame = p1.CFrame - Vector3.new(0,2,0)
- dust.Size = Vector3.new(10,0.05,10)
- local decal = Instance.new("Decal",dust)
- decal.Name = "tnt dust"
- decal.Texture = "rbxassetid://2963636012"
- decal.Transparency = 0
- decal.Face = "Top"
- p2.Parent = dust
- if mode == 1 then
- local boomcollide = Instance.new("Sound",dust)
- boomcollide.Volume = 2
- boomcollide.Looped = false
- boomcollide.SoundId = "rbxassetid://301924340"
- boomcollide:Play()
- boomcollide.TimePosition = 3.25
- end
- spawn(function()
- if p3 ~= nil then
- p3.Parent = dust
- end
- end)
- effect(dust,.1)
- p1:Destroy()
- spawn(function()
- local Info = TweenInfo.new(4,Enum.EasingStyle.Linear)
- local tween = TweenService:Create(decal,Info,{Transparency = 1})
- tween:Play()
- wait(4)
- dust:Destroy()
- end)
- end)
- end
- if part and not part:FindFirstChild("exploded") then
- rip(part,p,2,boom,false)
- end
- end
- part.ChildAdded:Connect(function(obj)
- if obj.ClassName == "Fire" and exploding == false then
- if obj.Enabled ~= true then return end
- explode()
- end
- end)
- confirm.Changed:Connect(function()
- if confirm.Value ~= true then return end
- exploding = true
- local function rip(p1,p2,mode,p3,manual)
- spawn(function()
- local boomcollide = nil
- if mode == 1 then
- p1.Anchored = false
- p1.BrickColor = BrickColor.new("Institutional white")
- wait(.25)
- elseif mode == 2 then
- end
- local ex = Instance.new("Explosion",workspace)
- ex.Position = p1.Position
- ex.BlastRadius = 15
- ex.BlastPressure = 1000000
- ex.DestroyJointRadiusPercent = 100
- ex.ExplosionType = "CratersAndDebris"
- ex.Hit:connect(function(Part, Distance)
- if Distance <= 15 and Part.Name ~= "tnt block" and Part.Name ~= "tnt dust" and Part.Parent.Name ~= "tnt dust" then
- Part.Anchored = false
- Part:BreakJoints()
- elseif Part.Name == "tnt block" and not Part:FindFirstChild("exploded") and not Part then
- local done = Instance.new("NumberValue",Part)
- done.Name = "exploded"
- Part.Anchored = false
- rip(Part,Part:FindFirstChild("ClickDetector"),1,nil,false)
- end
- end)
- --decals.Transparency = 0
- local dust = Instance.new("Part",workspace)
- dust.Name = "tnt dust"
- dust.Anchored = true
- dust.CanCollide = false
- dust.Transparency = 1
- dust.CFrame = p1.CFrame - Vector3.new(0,2,0)
- dust.Size = Vector3.new(10,0.05,10)
- local decal = Instance.new("Decal",dust)
- decal.Name = "tnt dust"
- decal.Texture = "rbxassetid://2963636012"
- decal.Transparency = 0
- decal.Face = "Top"
- p2.Parent = dust
- if mode == 1 then
- local boomcollide = Instance.new("Sound",dust)
- boomcollide.Volume = 2
- boomcollide.Looped = false
- boomcollide.SoundId = "rbxassetid://301924340"
- boomcollide:Play()
- boomcollide.TimePosition = 3.25
- end
- spawn(function()
- if p3 ~= nil then
- p3.Parent = dust
- end
- end)
- effect(dust,.1)
- p1:Destroy()
- spawn(function()
- local Info = TweenInfo.new(4,Enum.EasingStyle.Linear)
- local tween = TweenService:Create(decal,Info,{Transparency = 1})
- tween:Play()
- wait(4)
- dust:Destroy()
- end)
- end)
- end
- if part and not part:FindFirstChild("exploded") then
- rip(part,p,1,nil,true)
- end
- end)
- p.MouseClick:Connect(function(plr)
- if exploding == false then
- exploding = true
- --[[local fire = Instance.new("Fire",part)
- fire.Heat = 10
- fire.Size = 4
- fire.Color = Color3.new(.666666667,.666666667,0)
- fire.SecondaryColor = Color3.new(.545098039,0,.00784313725)
- fire.Enabled = true]]
- local ignite = Instance.new("Sound",part)
- ignite.Volume = 1
- ignite.MaxDistance = 50
- ignite.Looped = false
- ignite.SoundId = "rbxassetid://142587309"
- ignite:Play()
- explode()
- end
- end)
- end
- local remote = Instance.new("RemoteEvent",owner.Character)
- remote.Name = "Remote"
- ls = [[
- plr = owner
- mouse = plr:GetMouse()
- remote = plr.Character:WaitForChild("Remote")
- spawn(function()
- while wait() do
- local pos = mouse.Hit.p
- remote:FireServer(pos,5)
- end
- end)
- mouse.KeyDown:Connect(function(key)
- if key == "e" then
- local pos = mouse.Hit.p
- remote:FireServer(pos,1)
- end
- if key == "f" then
- holding = true
- while holding == true do
- local pos = mouse.Hit.p
- remote:FireServer(pos,1)
- wait(.1)
- end
- end
- if key == "q" then
- local pos = mouse.Hit.p
- remote:FireServer(pos,2)
- end
- if key == "r" then
- local pos = mouse.Hit.p
- remote:FireServer(pos,3)
- end
- if key == "t" then
- local pos = mouse.Hit.p
- remote:FireServer(pos,4)
- end
- end)
- mouse.KeyUp:Connect(function(key)
- if key == "f" then
- holding = false
- end
- end)
- ]]
- NLS(ls,owner.Character)
- local preplace = nil
- local preplacepart = nil
- local placing = true
- local lastmpos = nil
- spawn(function()
- while wait() do
- while placing do
- if preplace == nil or preplacepart == nil or preplace.Parent == nil or preplacepart.Parent == nil then
- preplacepart = Instance.new("Part")
- preplace = Instance.new("BlockMesh")
- preplacepart.Parent = workspace
- preplacepart.CFrame = CFrame.new(0,0,0)
- preplacepart.Transparency = 0.75
- preplacepart.Size = Vector3.new(0.05, 0.05, 0.05)
- preplacepart.Anchored = true
- preplacepart.BrickColor = BrickColor.new("Really red")
- preplacepart.CanCollide = false
- preplacepart.Material = Enum.Material.Neon
- preplacepart.brickColor = BrickColor.new("Really red")
- preplace.Parent = preplacepart
- preplace.Scale = Vector3.new(80, 80, 80)
- end
- wait()
- if preplace and preplacepart and lastmpos ~= nil then
- preplace.Offset = Vector3.new(math.floor(lastmpos.X/4)*4 + 2,math.floor(lastmpos.Y/4)*4 + 2,math.floor(lastmpos.Z/4)*4 + 2)
- end
- end
- end
- end)
- remote.OnServerEvent:Connect(function(plr,pos,mode)
- if mode == 1 then
- if not placing then return end
- createtnt(pos)
- elseif mode == 2 then
- if not placing then return end
- for i,v in pairs(workspace:GetChildren()) do
- if v.Name == "tnt block" and v:FindFirstChild("confirm") then
- igniteall(v,v:FindFirstChild("ClickDetector"),v:FindFirstChild("ClickDetector"):FindFirstChild("Sound"))
- end
- end
- warn("Exploded all tnt.")
- elseif mode == 3 then
- if not placing then return end
- for i,v in pairs(workspace:GetChildren()) do
- if v.Name == "tnt block" and v:FindFirstChild("confirm") then
- v:Destroy()
- end
- end
- warn("Cleared all tnt.")
- elseif mode == 4 then
- placing = not placing
- if placing then
- warn("placing enabled")
- elseif not placing then
- warn("placing disabled")
- if preplace then
- preplace:Destroy()
- end
- if preplacepart then
- preplacepart:Destroy()
- end
- end
- elseif mode == 5 then
- lastmpos = pos
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement