Advertisement
KrYn0MoRe

tnt [old]

Jun 2nd, 2022
1,016
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 19.26 KB | None | 0 0
  1. local TweenService = game:GetService("TweenService")
  2.  
  3. function DescendantAdded(item)
  4.     if item:IsA("Explosion") then
  5.         item.Hit:Connect(function(hit)
  6.             local c = hit:FindFirstChild("confirm")
  7.             if c and c:IsA("BoolValue") then
  8.                 c.Value = true
  9.             end
  10.         end)
  11.     end
  12. end
  13. workspace.DescendantAdded:Connect(DescendantAdded)
  14.  
  15. function effect(p,wt)
  16.     local ParticleEmitter1 = Instance.new("ParticleEmitter")
  17.     local ParticleEmitter2 = Instance.new("ParticleEmitter")
  18.     local ParticleEmitter3 = Instance.new("ParticleEmitter")
  19.     local ParticleEmitter4 = Instance.new("ParticleEmitter")
  20.     local ParticleEmitter5 = Instance.new("ParticleEmitter")
  21.     local ParticleEmitter6 = Instance.new("ParticleEmitter")
  22.     local ParticleEmitter7 = Instance.new("ParticleEmitter")
  23.     ParticleEmitter1.Name = "boom"
  24.     ParticleEmitter1.Parent = p
  25.     ParticleEmitter1.Speed = NumberRange.new(12, 17)
  26.     ParticleEmitter1.Enabled = false
  27.     ParticleEmitter1.LightInfluence = 1
  28.     ParticleEmitter1.Texture = "rbxassetid://3607612429"
  29.     ParticleEmitter1.Lifetime = NumberRange.new(0.5, 1.5)
  30.     ParticleEmitter1.Rate = 500
  31.     ParticleEmitter1.SpreadAngle = Vector2.new(90, 90)
  32.     ParticleEmitter1.VelocitySpread = 90
  33.     ParticleEmitter2.Name = "boom"
  34.     ParticleEmitter2.Parent = p
  35.     ParticleEmitter2.Speed = NumberRange.new(12, 17)
  36.     ParticleEmitter2.Enabled = false
  37.     ParticleEmitter2.LightInfluence = 1
  38.     ParticleEmitter2.Texture = "rbxassetid://3607612660"
  39.     ParticleEmitter2.Lifetime = NumberRange.new(0.5, 1.5)
  40.     ParticleEmitter2.Rate = 500
  41.     ParticleEmitter2.SpreadAngle = Vector2.new(90, 90)
  42.     ParticleEmitter2.VelocitySpread = 90
  43.     ParticleEmitter3.Name = "boom"
  44.     ParticleEmitter3.Parent = p
  45.     ParticleEmitter3.Speed = NumberRange.new(12, 17)
  46.     ParticleEmitter3.Enabled = false
  47.     ParticleEmitter3.LightInfluence = 1
  48.     ParticleEmitter3.Texture = "rbxassetid://3607613049"
  49.     ParticleEmitter3.Lifetime = NumberRange.new(0.5, 1.5)
  50.     ParticleEmitter3.Rate = 500
  51.     ParticleEmitter3.SpreadAngle = Vector2.new(90, 90)
  52.     ParticleEmitter3.VelocitySpread = 90
  53.     ParticleEmitter4.Name = "boom"
  54.     ParticleEmitter4.Parent = p
  55.     ParticleEmitter4.Speed = NumberRange.new(12, 17)
  56.     ParticleEmitter4.Enabled = false
  57.     ParticleEmitter4.LightInfluence = 1
  58.     ParticleEmitter4.Texture = "rbxassetid://3607612871"
  59.     ParticleEmitter4.Lifetime = NumberRange.new(0.5, 1.5)
  60.     ParticleEmitter4.Rate = 500
  61.     ParticleEmitter4.SpreadAngle = Vector2.new(90, 90)
  62.     ParticleEmitter4.VelocitySpread = 90
  63.     ParticleEmitter5.Name = "ex10"
  64.     ParticleEmitter5.Parent = p
  65.     ParticleEmitter5.Speed = NumberRange.new(12, 15)
  66.     ParticleEmitter5.Enabled = false
  67.     ParticleEmitter5.LightInfluence = 1
  68.     ParticleEmitter5.Texture = "rbxassetid://3607568189"
  69.     ParticleEmitter5.Size = NumberSequence.new(2,2)
  70.     ParticleEmitter5.Lifetime = NumberRange.new(0.5, 1)
  71.     ParticleEmitter5.Rate = 100
  72.     ParticleEmitter5.RotSpeed = NumberRange.new(160, 160)
  73.     ParticleEmitter5.SpreadAngle = Vector2.new(90, 90)
  74.     ParticleEmitter5.VelocitySpread = 90
  75.     ParticleEmitter6.Name = "ex12"
  76.     ParticleEmitter6.Parent = p
  77.     ParticleEmitter6.Speed = NumberRange.new(12, 15)
  78.     ParticleEmitter6.Enabled = false
  79.     ParticleEmitter6.LightInfluence = 1
  80.     ParticleEmitter6.Texture = "rbxassetid://3607567959"
  81.     ParticleEmitter6.Size = NumberSequence.new(2,2)
  82.     ParticleEmitter6.Lifetime = NumberRange.new(0.5, 1)
  83.     ParticleEmitter6.Rate = 100
  84.     ParticleEmitter6.RotSpeed = NumberRange.new(160, 160)
  85.     ParticleEmitter6.SpreadAngle = Vector2.new(90, 90)
  86.     ParticleEmitter6.VelocitySpread = 90
  87.     ParticleEmitter7.Name = "ex9"
  88.     ParticleEmitter7.Parent = p
  89.     ParticleEmitter7.Speed = NumberRange.new(12, 15)
  90.     ParticleEmitter7.Enabled = false
  91.     ParticleEmitter7.LightInfluence = 1
  92.     ParticleEmitter7.Texture = "rbxassetid://3607568450"
  93.     ParticleEmitter7.Size = NumberSequence.new(2,2)
  94.     ParticleEmitter7.Lifetime = NumberRange.new(0.5, 1)
  95.     ParticleEmitter7.Rate = 100
  96.     ParticleEmitter7.RotSpeed = NumberRange.new(160, 160)
  97.     ParticleEmitter7.SpreadAngle = Vector2.new(90, 90)
  98.     ParticleEmitter7.VelocitySpread = 90
  99.     spawn(function()
  100.         ParticleEmitter1.Enabled = true
  101.         ParticleEmitter2.Enabled = true
  102.         ParticleEmitter3.Enabled = true
  103.         ParticleEmitter4.Enabled = true
  104.         ParticleEmitter5.Enabled = true
  105.         ParticleEmitter6.Enabled = true
  106.         ParticleEmitter7.Enabled = true
  107.         wait(wt) -- crappy coded here but idc lol
  108.         ParticleEmitter1.Enabled = false
  109.         ParticleEmitter2.Enabled = false
  110.         ParticleEmitter3.Enabled = false
  111.         ParticleEmitter4.Enabled = false
  112.         ParticleEmitter5.Enabled = false
  113.         ParticleEmitter6.Enabled = false
  114.         ParticleEmitter7.Enabled = false
  115.     end)
  116. end
  117.  
  118. function igniteall(p1,p2,p3)
  119.     local function rip(p1,p2,mode,p3,manual)
  120.         spawn(function()
  121.             local boomcollide = nil
  122.             if mode == 1 then
  123.                 p1.BrickColor = BrickColor.new("Institutional white")
  124.                 wait(.25)
  125.             elseif mode == 2 then
  126.             end
  127.             local ex = Instance.new("Explosion",workspace)
  128.             ex.Position = p1.Position
  129.             ex.BlastRadius = 15
  130.             ex.BlastPressure = 1000000
  131.             ex.DestroyJointRadiusPercent = 100
  132.             ex.ExplosionType = "CratersAndDebris"
  133.             ex.Hit:connect(function(Part, Distance)
  134.                 if Distance <= 15 and Part.Name ~= "tnt block" and Part.Name ~= "tnt dust" and Part.Parent.Name ~= "tnt dust" then
  135.                     Part.Anchored = false
  136.                     Part:BreakJoints()
  137.                 elseif Part.Name == "tnt block" and not Part:FindFirstChild("exploded") and not Part then
  138.                     Part.Anchored = false
  139.                     local done = Instance.new("NumberValue",Part)
  140.                     done.Name = "exploded"
  141.                     Part.Anchored = false
  142.                     rip(Part,Part:FindFirstChild("ClickDetector"),1,nil,false)
  143.                 end
  144.             end)
  145.             --decals.Transparency = 0
  146.             local dust = Instance.new("Part",workspace)
  147.             dust.Name = "tnt dust"
  148.             dust.Anchored = true
  149.             dust.CanCollide = false
  150.             dust.Transparency = 1
  151.             dust.CFrame = p1.CFrame - Vector3.new(0,2,0)
  152.             dust.Size = Vector3.new(10,0.05,10)
  153.             local decal = Instance.new("Decal",dust)
  154.             decal.Name = "tnt dust"
  155.             decal.Texture = "rbxassetid://2963636012"
  156.             decal.Transparency = 0
  157.             decal.Face = "Top"
  158.             p2.Parent = dust
  159.             if mode == 1 then
  160.                 local boomcollide = Instance.new("Sound",dust)
  161.                 boomcollide.Volume = 2
  162.                 boomcollide.Looped = false
  163.                 boomcollide.SoundId = "rbxassetid://301924340"
  164.                 boomcollide:Play()
  165.                 boomcollide.TimePosition = 3.25
  166.             end
  167.             spawn(function()
  168.                 if p3 ~= nil then
  169.                     p3.Parent = dust
  170.                 end
  171.             end)
  172.             effect(dust,.1)
  173.             p1:Destroy()
  174.             spawn(function()
  175.                 local Info = TweenInfo.new(4,Enum.EasingStyle.Linear)
  176.                 local tween = TweenService:Create(decal,Info,{Transparency = 1})
  177.                 tween:Play()
  178.                 wait(4)
  179.                 dust:Destroy()
  180.             end)
  181.         end)
  182.     end
  183.     spawn(function()
  184.         if p3 == nil then
  185.             p1.BrickColor = BrickColor.new("Institutional white")
  186.             wait(.25)
  187.         else
  188.             for i,v in pairs(p1:GetChildren()) do
  189.                 if v:IsA("Decal") then
  190.                     spawn(function()
  191.                         while p1 ~= nil do
  192.                             p1.BrickColor = BrickColor.new("Institutional white")
  193.                             v.Transparency = 1
  194.                             wait(.4)
  195.                             p1.BrickColor = BrickColor.new("Really red")
  196.                             v.Transparency = 0
  197.                             wait(.4)
  198.                         end
  199.                     end)
  200.                 end
  201.             end
  202.         end
  203.         local ex = Instance.new("Explosion",workspace)
  204.         ex.Position = p1.Position
  205.         ex.BlastRadius = 15
  206.         ex.BlastPressure = 1000000
  207.         ex.DestroyJointRadiusPercent = 100
  208.         ex.ExplosionType = "CratersAndDebris"
  209.         ex.Hit:connect(function(Part, Distance)
  210.             if Distance <= 15 and Part.Name ~= "tnt block" and Part.Name ~= "tnt dust" and Part.Parent.Name ~= "tnt dust" then
  211.                 Part.Anchored = false
  212.                 Part:BreakJoints()
  213.             elseif Part.Name == "tnt block" and not Part:FindFirstChild("exploded") and not Part then
  214.                 Part.Anchored = false
  215.                 local done = Instance.new("NumberValue",Part)
  216.                 done.Name = "exploded"
  217.                 Part.Anchored = false
  218.                 rip(Part,Part:FindFirstChild("ClickDetector"),1,nil,false)
  219.             end
  220.         end)
  221.         --decals.Transparency = 0
  222.         local dust = Instance.new("Part",workspace)
  223.         dust.Name = "tnt dust"
  224.         dust.Anchored = true
  225.         dust.CanCollide = false
  226.         dust.Transparency = 1
  227.         dust.CFrame = p1.CFrame - Vector3.new(0,2,0)
  228.         dust.Size = Vector3.new(10,0.05,10)
  229.         local decal = Instance.new("Decal",dust)
  230.         decal.Name = "tnt dust"
  231.         decal.Texture = "rbxassetid://2963636012"
  232.         decal.Transparency = 0
  233.         decal.Face = "Top"
  234.         p2.Parent = dust
  235.         local boomcollide = Instance.new("Sound",dust)
  236.         boomcollide.Volume = 2
  237.         boomcollide.Looped = false
  238.         boomcollide.SoundId = "rbxassetid://301924340"
  239.         boomcollide:Play()
  240.         boomcollide.TimePosition = 3.25
  241.         spawn(function()
  242.             if p3 ~= nil then
  243.                 p3.Parent = dust
  244.             end
  245.         end)
  246.         effect(dust,.1)
  247.         p1:Destroy()
  248.         spawn(function()
  249.             local Info = TweenInfo.new(4,Enum.EasingStyle.Linear)
  250.             local tween = TweenService:Create(decal,Info,{Transparency = 1})
  251.             tween:Play()
  252.             wait(4)
  253.             dust:Destroy()
  254.         end)
  255.     end)
  256. end
  257.  
  258. function createtnt(m)
  259.     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)
  260.     local overlap = false
  261.     local D = workspace:GetDescendants()
  262.     for i = 1,#D do
  263.         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
  264.             overlap = true
  265.         end
  266.     end
  267.     if overlap then return end
  268.     local exploding = false
  269.     local part = Instance.new("Part",workspace)
  270.     part.Name = "tnt block"
  271.     part.Position = P
  272.     part.BrickColor = BrickColor.new("Really red")
  273.     part.CastShadow = true
  274.     part.Material = Enum.Material.Neon
  275.     part.Size = Vector3.new(4,4,4)
  276.     part.Anchored = true
  277.     part.CanCollide = true
  278.     part.Massless = true
  279.     local confirm = Instance.new("BoolValue",part)
  280.     confirm.Name = "confirm"
  281.     local p = Instance.new("ClickDetector",part)
  282.     p.MaxActivationDistance = 10
  283.     p.CursorIcon = "rbxassetid://93681360"
  284.     local Decal0 = Instance.new("Decal")
  285.     local Decal1 = Instance.new("Decal")
  286.     local Decal2 = Instance.new("Decal")
  287.     local Decal3 = Instance.new("Decal")
  288.     local Decal4 = Instance.new("Decal")
  289.     local Decal5 = Instance.new("Decal")
  290.     Decal0.Parent = part
  291.     Decal0.Texture = "http://www.roblox.com/asset/?id=48005067"
  292.     Decal1.Parent = part
  293.     Decal1.Texture = "http://www.roblox.com/asset/?id=48005064"
  294.     Decal1.Face = Enum.NormalId.Bottom
  295.     Decal2.Parent = part
  296.     Decal2.Texture = "http://www.roblox.com/asset/?id=48005067"
  297.     Decal2.Face = Enum.NormalId.Back
  298.     Decal3.Parent = part
  299.     Decal3.Texture = "http://www.roblox.com/asset/?id=48005073"
  300.     Decal3.Face = Enum.NormalId.Top
  301.     Decal4.Parent = part
  302.     Decal4.Texture = "http://www.roblox.com/asset/?id=48005067"
  303.     Decal4.Face = Enum.NormalId.Left
  304.     Decal5.Parent = part
  305.     Decal5.Texture = "http://www.roblox.com/asset/?id=48005067"
  306.     Decal5.Face = Enum.NormalId.Right
  307.  
  308.     local function explode()
  309.         local boom = Instance.new("Sound",part)
  310.         boom.Volume = 2
  311.         boom.Looped = false
  312.         boom.SoundId = "rbxassetid://301924340"
  313.         boom:Play()
  314.         part.Anchored = false
  315.         part.CanCollide = true
  316.         part.CFrame = part.CFrame + Vector3.new(0,1,0)
  317.         p.MaxActivationDistance = 0
  318.         local decals = nil
  319.         for i,v in pairs(part:GetChildren()) do
  320.             if v:IsA("Decal") then
  321.                 spawn(function()
  322.                     decals = v
  323. --[[local Info = TweenInfo.new(3,Enum.EasingStyle.Linear)
  324. local tween = TweenService:Create(v,Info,{Transparency = .5})
  325. tween:Play()]]
  326.                     while part ~= nil do
  327.                         part.BrickColor = BrickColor.new("Institutional white")
  328.                         v.Transparency = 1
  329.                         wait(.4)
  330.                         part.BrickColor = BrickColor.new("Really red")
  331.                         v.Transparency = 0
  332.                         wait(.4)
  333.                     end
  334.                 end)
  335.             end
  336.         end
  337.         wait(3)
  338.         local function rip(p1,p2,mode,p3,manual)
  339.             spawn(function()
  340.                 if mode == 1 then
  341.                     p1.BrickColor = BrickColor.new("Institutional white")
  342.                     wait(.25)
  343.                 elseif mode == 2 then
  344.                 end
  345.                 local ex = Instance.new("Explosion",workspace)
  346.                 ex.Position = p1.Position
  347.                 ex.BlastRadius = 15
  348.                 ex.BlastPressure = 1000000
  349.                 ex.DestroyJointRadiusPercent = 100
  350.                 ex.ExplosionType = "CratersAndDebris"
  351.                 ex.Hit:connect(function(Part, Distance)
  352.                     if Distance <= 15 and Part.Name ~= "tnt block" and Part.Name ~= "tnt dust" and Part.Parent.Name ~= "tnt dust" then
  353.                         Part.Anchored = false
  354.                         Part:BreakJoints()
  355.                     elseif Part.Name == "tnt block" and not Part:FindFirstChild("exploded") and not Part then
  356.                         Part.Anchored = false
  357.                         local done = Instance.new("NumberValue",Part)
  358.                         done.Name = "exploded"
  359.                         Part.Anchored = false
  360.                         rip(Part,Part:FindFirstChild("ClickDetector"),1,nil,false)
  361.                     end
  362.                 end)
  363.                 --decals.Transparency = 0
  364.                 local dust = Instance.new("Part",workspace)
  365.                 dust.Name = "tnt dust"
  366.                 dust.Anchored = true
  367.                 dust.CanCollide = false
  368.                 dust.Transparency = 1
  369.                 dust.CFrame = p1.CFrame - Vector3.new(0,2,0)
  370.                 dust.Size = Vector3.new(10,0.05,10)
  371.                 local decal = Instance.new("Decal",dust)
  372.                 decal.Name = "tnt dust"
  373.                 decal.Texture = "rbxassetid://2963636012"
  374.                 decal.Transparency = 0
  375.                 decal.Face = "Top"
  376.                 p2.Parent = dust
  377.                 if mode == 1 then
  378.                     local boomcollide = Instance.new("Sound",dust)
  379.                     boomcollide.Volume = 2
  380.                     boomcollide.Looped = false
  381.                     boomcollide.SoundId = "rbxassetid://301924340"
  382.                     boomcollide:Play()
  383.                     boomcollide.TimePosition = 3.25
  384.                 end
  385.                 spawn(function()
  386.                     if p3 ~= nil then
  387.                         p3.Parent = dust
  388.                     end
  389.                 end)
  390.                 effect(dust,.1)
  391.                 p1:Destroy()
  392.                 spawn(function()
  393.                     local Info = TweenInfo.new(4,Enum.EasingStyle.Linear)
  394.                     local tween = TweenService:Create(decal,Info,{Transparency = 1})
  395.                     tween:Play()
  396.                     wait(4)
  397.                     dust:Destroy()
  398.                 end)
  399.             end)
  400.         end
  401.         if part and not part:FindFirstChild("exploded") then
  402.             rip(part,p,2,boom,false)
  403.         end
  404.     end
  405.  
  406.     part.ChildAdded:Connect(function(obj)
  407.         if obj.ClassName == "Fire" and exploding == false then
  408.             if obj.Enabled ~= true then return end
  409.             explode()
  410.         end
  411.     end)
  412.     confirm.Changed:Connect(function()
  413.         if confirm.Value ~= true then return end
  414.         exploding = true
  415.         local function rip(p1,p2,mode,p3,manual)
  416.             spawn(function()
  417.                 local boomcollide = nil
  418.                 if mode == 1 then
  419.                     p1.Anchored = false
  420.                     p1.BrickColor = BrickColor.new("Institutional white")
  421.                     wait(.25)
  422.                 elseif mode == 2 then
  423.                 end
  424.                 local ex = Instance.new("Explosion",workspace)
  425.                 ex.Position = p1.Position
  426.                 ex.BlastRadius = 15
  427.                 ex.BlastPressure = 1000000
  428.                 ex.DestroyJointRadiusPercent = 100
  429.                 ex.ExplosionType = "CratersAndDebris"
  430.                 ex.Hit:connect(function(Part, Distance)
  431.                     if Distance <= 15 and Part.Name ~= "tnt block" and Part.Name ~= "tnt dust" and Part.Parent.Name ~= "tnt dust" then
  432.                         Part.Anchored = false
  433.                         Part:BreakJoints()
  434.                     elseif Part.Name == "tnt block" and not Part:FindFirstChild("exploded") and not Part then
  435.                         local done = Instance.new("NumberValue",Part)
  436.                         done.Name = "exploded"
  437.                         Part.Anchored = false
  438.                         rip(Part,Part:FindFirstChild("ClickDetector"),1,nil,false)
  439.                     end
  440.                 end)
  441.                 --decals.Transparency = 0
  442.                 local dust = Instance.new("Part",workspace)
  443.                 dust.Name = "tnt dust"
  444.                 dust.Anchored = true
  445.                 dust.CanCollide = false
  446.                 dust.Transparency = 1
  447.                 dust.CFrame = p1.CFrame - Vector3.new(0,2,0)
  448.                 dust.Size = Vector3.new(10,0.05,10)
  449.                 local decal = Instance.new("Decal",dust)
  450.                 decal.Name = "tnt dust"
  451.                 decal.Texture = "rbxassetid://2963636012"
  452.                 decal.Transparency = 0
  453.                 decal.Face = "Top"
  454.                 p2.Parent = dust
  455.                 if mode == 1 then
  456.                     local boomcollide = Instance.new("Sound",dust)
  457.                     boomcollide.Volume = 2
  458.                     boomcollide.Looped = false
  459.                     boomcollide.SoundId = "rbxassetid://301924340"
  460.                     boomcollide:Play()
  461.                     boomcollide.TimePosition = 3.25
  462.                 end
  463.                 spawn(function()
  464.                     if p3 ~= nil then
  465.                         p3.Parent = dust
  466.                     end
  467.                 end)
  468.                 effect(dust,.1)
  469.                 p1:Destroy()
  470.                 spawn(function()
  471.                     local Info = TweenInfo.new(4,Enum.EasingStyle.Linear)
  472.                     local tween = TweenService:Create(decal,Info,{Transparency = 1})
  473.                     tween:Play()
  474.                     wait(4)
  475.                     dust:Destroy()
  476.                 end)
  477.             end)
  478.         end
  479.         if part and not part:FindFirstChild("exploded") then
  480.             rip(part,p,1,nil,true)
  481.         end
  482.     end)
  483.     p.MouseClick:Connect(function(plr)
  484.         if exploding == false then
  485.             exploding = true
  486. --[[local fire = Instance.new("Fire",part)
  487. fire.Heat = 10
  488. fire.Size = 4
  489. fire.Color = Color3.new(.666666667,.666666667,0)
  490. fire.SecondaryColor = Color3.new(.545098039,0,.00784313725)
  491. fire.Enabled = true]]
  492.             local ignite = Instance.new("Sound",part)
  493.             ignite.Volume = 1
  494.             ignite.MaxDistance = 50
  495.             ignite.Looped = false
  496.             ignite.SoundId = "rbxassetid://142587309"
  497.             ignite:Play()
  498.             explode()
  499.         end
  500.     end)
  501. end
  502.  
  503. local remote = Instance.new("RemoteEvent",owner.Character)
  504. remote.Name = "Remote"
  505.  
  506. ls = [[
  507. plr = owner
  508. mouse = plr:GetMouse()
  509. remote = plr.Character:WaitForChild("Remote")
  510. spawn(function()
  511.     while wait() do
  512.         local pos = mouse.Hit.p
  513.         remote:FireServer(pos,5)
  514.     end
  515. end)
  516. mouse.KeyDown:Connect(function(key)
  517.     if key == "e" then
  518.         local pos = mouse.Hit.p
  519.         remote:FireServer(pos,1)
  520.     end
  521.     if key == "f" then
  522.         holding = true
  523.         while holding == true do
  524.             local pos = mouse.Hit.p
  525.             remote:FireServer(pos,1)
  526.             wait(.1)
  527.         end
  528.     end
  529.     if key == "q" then
  530.         local pos = mouse.Hit.p
  531.         remote:FireServer(pos,2)
  532.     end
  533.     if key == "r" then
  534.         local pos = mouse.Hit.p
  535.         remote:FireServer(pos,3)
  536.     end
  537.     if key == "t" then
  538.         local pos = mouse.Hit.p
  539.         remote:FireServer(pos,4)
  540.     end
  541. end)
  542. mouse.KeyUp:Connect(function(key)
  543.     if key == "f" then
  544.         holding = false
  545.     end
  546. end)
  547. ]]
  548.  
  549. NLS(ls,owner.Character)
  550.  
  551. local preplace = nil
  552. local preplacepart =  nil
  553. local placing = true
  554. local lastmpos = nil
  555.  
  556. spawn(function()
  557.     while wait() do
  558.         while placing do
  559.             if preplace == nil or preplacepart == nil or preplace.Parent == nil or preplacepart.Parent == nil then
  560.                 preplacepart = Instance.new("Part")
  561.                 preplace = Instance.new("BlockMesh")
  562.                 preplacepart.Parent = workspace
  563.                 preplacepart.CFrame = CFrame.new(0,0,0)
  564.                 preplacepart.Transparency = 0.75
  565.                 preplacepart.Size = Vector3.new(0.05, 0.05, 0.05)
  566.                 preplacepart.Anchored = true
  567.                 preplacepart.BrickColor = BrickColor.new("Really red")
  568.                 preplacepart.CanCollide = false
  569.                 preplacepart.Material = Enum.Material.Neon
  570.                 preplacepart.brickColor = BrickColor.new("Really red")
  571.                 preplace.Parent = preplacepart
  572.                 preplace.Scale = Vector3.new(80, 80, 80)
  573.             end
  574.             wait()
  575.             if preplace and preplacepart and lastmpos ~= nil then
  576.                 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)
  577.             end
  578.         end
  579.     end
  580. end)
  581.  
  582. remote.OnServerEvent:Connect(function(plr,pos,mode)
  583.     if mode == 1 then
  584.         if not placing then return end
  585.         createtnt(pos)
  586.     elseif mode == 2 then
  587.         if not placing then return end
  588.         for i,v in pairs(workspace:GetChildren()) do
  589.             if v.Name == "tnt block" and v:FindFirstChild("confirm") then
  590.                 igniteall(v,v:FindFirstChild("ClickDetector"),v:FindFirstChild("ClickDetector"):FindFirstChild("Sound"))
  591.             end
  592.         end
  593.         warn("Exploded all tnt.")
  594.     elseif mode == 3 then
  595.         if not placing then return end
  596.         for i,v in pairs(workspace:GetChildren()) do
  597.             if v.Name == "tnt block" and v:FindFirstChild("confirm") then
  598.                 v:Destroy()
  599.             end
  600.         end
  601.         warn("Cleared all tnt.")
  602.     elseif mode == 4 then
  603.         placing = not placing
  604.         if placing then
  605.             warn("placing enabled")
  606.         elseif not placing then
  607.             warn("placing disabled")
  608.             if preplace then
  609.                 preplace:Destroy()
  610.             end
  611.             if preplacepart then
  612.                 preplacepart:Destroy()
  613.             end
  614.         end
  615.     elseif mode == 5 then
  616.         lastmpos = pos
  617.     end
  618. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement