Advertisement
KrYn0MoRe

c4

Sep 29th, 2020
1,704
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.29 KB | None | 0 0
  1. local plr = owner
  2. local char = plr.Character
  3. local hum = char:FindFirstChildOfClass("Humanoid")
  4. local torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
  5.  
  6. debris = game:GetService("Debris")
  7. tween = game:GetService("TweenService")
  8.  
  9. local ToolEquipped = false
  10. local holding = false
  11. local equipped = false
  12. local using = false
  13.  
  14. local Tool0 = Instance.new("Tool")
  15. local Part1 = Instance.new("Part")
  16. local SpecialMesh2 = Instance.new("SpecialMesh")
  17. Tool0.Name = "C4"
  18. Tool0.Parent = plr['Backpack']
  19. Tool0.TextureId = "rbxassetid://172171690"
  20. Tool0.Grip = CFrame.new(-0.600610614, -0.169408143, -8.8817842e-16, -0.808358014, 7.02007208e-09, -0.588691175, -0.588691175, -9.6395727e-09, 0.808358014, 0, 1, 1.19248806e-08)
  21. Tool0.ToolTip = "Plant the bomb, complete the objective."
  22. Part1.Name = "Handle"
  23. Part1.Parent = Tool0
  24. Part1.CFrame = CFrame.new(0.0049970001, 0.340999991, -0.00151099998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  25. Part1.Position = Vector3.new(0.0049970001, 0.340999991, -0.00151099998)
  26. Part1.Size = Vector3.new(1.59000003, 0.681999981, 2.26300001)
  27. Part1.BottomSurface = Enum.SurfaceType.Smooth
  28. Part1.TopSurface = Enum.SurfaceType.Smooth
  29. SpecialMesh2.Parent = Part1
  30. SpecialMesh2.MeshId = "rbxassetid://454801145"
  31. SpecialMesh2.Scale = Vector3.new(0.00200000009, 0.00200000009, 0.00200000009)
  32. SpecialMesh2.TextureId = "rbxassetid://454801149"
  33. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  34.  
  35. local handle = Part1
  36. local tool = Tool0
  37.  
  38. local equip = Instance.new("Sound",handle)
  39. equip.SoundId = "rbxassetid://169799883"
  40. equip.Volume = 10
  41. equip.EmitterSize = 1
  42.  
  43. local planting = Instance.new("Sound",handle)
  44. planting.SoundId = "rbxassetid://340617924"
  45. planting.Volume = 10
  46. planting.EmitterSize = 1
  47.  
  48. local planted = Instance.new("Sound",script)
  49. planted.SoundId = "rbxassetid://180746510"
  50. planted.Volume = 2
  51.  
  52. local twin = Instance.new("Sound",script)
  53. twin.SoundId = "rbxassetid://180746497"
  54. twin.Volume = 2
  55.  
  56. local ctwin = Instance.new("Sound",script)
  57. ctwin.SoundId = "rbxassetid://180746506"
  58. ctwin.Volume = 2
  59.  
  60. function explode(bomb)
  61.     local ex = Instance.new("Explosion",workspace)
  62.     ex.Visible = true
  63.     ex.Position = bomb.Position
  64.     ex.BlastRadius = 55
  65.     ex.BlastPressure = 1000000
  66.     ex.DestroyJointRadiusPercent = 100
  67.     ex.ExplosionType = "CratersAndDebris"
  68.     ex.Hit:connect(function(Part, Distance)
  69.         if Distance <= 55 and Part ~= bomb then
  70.             Part.Anchored = false
  71.             Part:BreakJoints()
  72.             if Part.Parent.ClassName == "Model" or Part.Parent.ClassName == "Part" or Part.Parent.ClassName == "Folder" then
  73.                 Part.Parent:BreakJoints()
  74.             end
  75.         end
  76.     end)
  77.     bomb:destroy()
  78.     debris:AddItem(ex,5)
  79.     wait(.5)
  80.     twin:Play()
  81. end
  82.  
  83. function timer(bomb)
  84.     local BillboardGui0 = Instance.new("BillboardGui")
  85.     local TextButton1 = Instance.new("TextBox")
  86.     BillboardGui0.Parent = bomb
  87.     BillboardGui0.Size = UDim2.new(40, 40, 1, 1)
  88.     BillboardGui0.Active = true
  89.     BillboardGui0.StudsOffset = Vector3.new(0, 3, 0)
  90.     TextButton1.Parent = BillboardGui0
  91.     TextButton1.Size = UDim2.new(1, 0, 1, 0)
  92.     TextButton1.BackgroundColor = BrickColor.new("Institutional white")
  93.     TextButton1.BackgroundColor3 = Color3.new(1, 1, 1)
  94.     TextButton1.BackgroundTransparency = 1
  95.     TextButton1.Selectable = false
  96.     TextButton1.Font = Enum.Font.SourceSans
  97.     TextButton1.FontSize = Enum.FontSize.Size14
  98.     TextButton1.Text = "Clicks left: 360"
  99.     TextButton1.TextColor = BrickColor.new("Salmon")
  100.     TextButton1.TextColor3 = Color3.new(1, 0.509804, 0.639216)
  101.     TextButton1.TextScaled = true
  102.     TextButton1.TextSize = 14
  103.     TextButton1.TextStrokeTransparency = 0.5
  104.     TextButton1.TextWrap = true
  105.     TextButton1.TextWrapped = true
  106.     TextButton1.TextYAlignment = Enum.TextYAlignment.Top
  107.     local clicks = 0
  108.     local clicker = Instance.new("ClickDetector",bomb)
  109.     clicker.MaxActivationDistance = 10
  110.     clicker.MouseClick:Connect(function()
  111.         clicks = clicks + 1
  112.         TextButton1.Text = "Clicks left: " .. tostring(360 - clicks)
  113.     end)
  114.     local beep = Instance.new("Sound",script)
  115.     beep.SoundId = "rbxassetid://1609211368"
  116.     beep.Volume = 1
  117.     beep:Play()
  118.     repeat wait() until beep.TimePosition >= 41 or clicks >= 360
  119.     clicker:Destroy()
  120.     if 360 > clicks then
  121.         explode(bomb)
  122.     elseif clicks >= 360 then
  123.         bomb:Destroy()
  124.         beep:Stop()
  125.         ctwin:Play()
  126.     end
  127. end
  128.  
  129. function plant()
  130.     local currentplr = plr
  131.     planting:Play()
  132.     wait(3)
  133.     if currentplr == plr and CheckIfAlive then else return end
  134.     planted:Play()
  135.     local bomb = handle:Clone()
  136.     bomb.Anchored = true
  137.     bomb.CanCollide = true
  138.     bomb.Parent = script
  139.     bomb.CFrame = torso.CFrame - Vector3.new(0,2.6,0)
  140.     if bomb and bomb.Parent then
  141.         tool:Destroy()
  142.         timer(bomb)
  143.     end
  144. end
  145.  
  146. tool.Equipped:Connect(function()
  147.     char = tool.Parent
  148.     plr = game:GetService("Players"):GetPlayerFromCharacter(char)
  149.     hum = char:FindFirstChildOfClass("Humanoid")
  150.     torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
  151.     if not CheckIfAlive() then tool.Parent = nil return end
  152.     equipped = true
  153.     equip:Play()
  154. end)
  155.  
  156. tool.Unequipped:Connect(function()
  157.     equipped = false
  158.     equip:Stop()
  159. end)
  160.  
  161. tool.Activated:Connect(function()
  162.     if not using then
  163.         using = true
  164.         plant()
  165.     end
  166. end)
  167.  
  168. function CheckIfAlive()
  169.     local alive = false
  170.     if (plr and plr.Parent and char and char.Parent and hum and hum.Parent and hum.Health > 0 and torso and torso.Parent) then
  171.         alive = true
  172.     end
  173.     return alive
  174. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement