Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game:GetService("Players").LocalPlayer
- local humanoid = character:WaitForChild("Humanoid")
- local runService = game:GetService("RunService")
- local mouse = player:GetMouse()
- local canequip = true
- script.Parent.MouseButton1Click:connect(function(deletetool)
- if canequip == true then
- canequip = false
- spawn(function()
- runService.RenderStepped:connect(function()
- character = player.Character
- end) end)
- pcall(function()
- local delete = Instance.new("Tool", player:WaitForChild("Backpack"))
- delete.Name = "delete"
- delete.TextureId = "rbxassetid://2806986819"
- delete.RequiresHandle = false
- humanoid:EquipTool(delete)
- delete.Equipped:connect(function(localmouse)
- local selection = Instance.new("SelectionBox", character)
- selection.Name = "Selection"
- spawn(function()
- while wait() do
- selection.Adornee = mouse.Target
- end
- end)
- localmouse.Button1Down:connect(function(i)
- local target = mouse.Target
- local explody = Instance.new("Explosion", workspace)
- explody.BlastRadius = nil
- explody.BlastPressure = nil
- explody.Position = target.Position
- target:Destroy()
- end)
- delete.Unequipped:connect(function(removeselection)
- selection:Destroy()
- end)
- end)
- end)
- else
- canequip = true
- humanoid:UnequipTools()
- for _k, v in pairs(character:GetChildren()) do
- if v:IsA("SelectionBox") then
- v:Destroy()
- end
- end
- for _k, v in pairs(player:WaitForChild("Backpack"):GetChildren()) do
- if v.Name == "delete" then
- v:Destroy()
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement