rrixh

tool ui destroyer

Oct 16th, 2023
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. local tool = Instance.new("Tool", game.Players.LocalPlayer.Backpack)
  2. tool.Name = "DestroyTool"
  3. tool.CanBeDropped = false
  4. tool.RequiresHandle = false
  5.  
  6. local equipped = false
  7. local Mouse = game.Players.LocalPlayer:GetMouse()
  8.  
  9. local box = Instance.new("SelectionBox", game.StarterGui)
  10. box.Adornee = nil
  11. box.Color3 = Color3.fromRGB(255, 255, 255)
  12. box.SurfaceColor3 = Color3.fromRGB(255, 255, 255)
  13. box.LineThickness = 0.1
  14.  
  15. Mouse.Button1Down:Connect(function()
  16.     if equipped == true then
  17.         Mouse.Target:Destroy()
  18.     end
  19. end)
  20.  
  21. tool.Equipped:Connect(function()
  22.     equipped = true
  23.     box.Parent = game.Workspace
  24.     while equipped == true do
  25.         wait(0.1)
  26.         box.Adornee = Mouse.Target
  27.     end
  28. end)
  29.  
  30. tool.Unequipped:Connect(function()
  31.     equipped = false
  32.     box.Adornee = nil
  33.     box.Parent = game.StarterGui
  34. end)
Add Comment
Please, Sign In to add comment