Advertisement
matta122

...

Feb 9th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. local player = game:GetService("Players").LocalPlayer
  2. local humanoid = character:WaitForChild("Humanoid")
  3. local runService = game:GetService("RunService")
  4. local mouse = player:GetMouse()
  5.  
  6. local canequip = true
  7.  
  8.  
  9. script.Parent.MouseButton1Click:connect(function(deletetool)
  10.  
  11. if canequip == true then
  12. canequip = false
  13.  
  14. spawn(function()
  15. runService.RenderStepped:connect(function()
  16. character = player.Character
  17. end) end)
  18. pcall(function()
  19.  
  20. local delete = Instance.new("Tool", player:WaitForChild("Backpack"))
  21. delete.Name = "delete"
  22. delete.TextureId = "rbxassetid://2806986819"
  23. delete.RequiresHandle = false
  24.  
  25. humanoid:EquipTool(delete)
  26.  
  27. delete.Equipped:connect(function(localmouse)
  28. local selection = Instance.new("SelectionBox", character)
  29. selection.Name = "Selection"
  30.  
  31. spawn(function()
  32. while wait() do
  33.  
  34. selection.Adornee = mouse.Target
  35. end
  36. end)
  37. localmouse.Button1Down:connect(function(i)
  38. local target = mouse.Target
  39. local explody = Instance.new("Explosion", workspace)
  40. explody.BlastRadius = nil
  41. explody.BlastPressure = nil
  42. explody.Position = target.Position
  43. target:Destroy()
  44. end)
  45.  
  46. delete.Unequipped:connect(function(removeselection)
  47. selection:Destroy()
  48. end)
  49. end)
  50.  
  51. end)
  52. else
  53.  
  54. canequip = true
  55.  
  56. humanoid:UnequipTools()
  57. for _k, v in pairs(character:GetChildren()) do
  58. if v:IsA("SelectionBox") then
  59. v:Destroy()
  60. end
  61. end
  62. for _k, v in pairs(player:WaitForChild("Backpack"):GetChildren()) do
  63. if v.Name == "delete" then
  64. v:Destroy()
  65. end
  66. end
  67. end
  68. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement