Advertisement
HenloMyDude

local delete tool

Mar 17th, 2020
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. plr = game:service("Players").LocalPlayer
  2. hum = plr.Character.HumanoidRootPart
  3. mouse = plr:GetMouse()
  4. tool = Instance.new("Tool", plr.Backpack)
  5. tool.Name = "collision off"
  6. tool.RequiresHandle = false
  7.  
  8. type = false
  9.  
  10. selected = Instance.new("SelectionBox", tool)
  11. selected.Adornee = nil
  12. selected.LineThickness = 0.5
  13. selected.Color3 = Color3.new(1, 1, 1)
  14.  
  15. tool.Activated:connect(function()
  16. local f = selected.Adornee
  17. if f then
  18. if type == false then
  19. f.CanCollide = false
  20. else
  21. f.CanCollide = true
  22. end
  23. end
  24. end)
  25.  
  26. mouse.KeyDown:connect(function(key)
  27. if key == "e" then
  28. if type == true then
  29. type = false
  30. else
  31. type = true
  32. end
  33. end
  34. end)
  35.  
  36. game:service("RunService").RenderStepped:connect(function()
  37.  
  38. if type == false then
  39. tool.Name = "collision off"
  40. else
  41. tool.Name = "collision on"
  42. end
  43.  
  44. if mouse.Target then
  45. selected.Adornee = mouse.Target
  46. else
  47. selected.Adornee = nil
  48. end
  49.  
  50. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement