SnowyShiro

FastDeleteBPS

Feb 28th, 2020
77,271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. Mouse = game.Players.LocalPlayer:GetMouse()
  2. Mouse.KeyDown:connect(function(key)
  3. if key:lower() == "l" then
  4. delitem = Mouse.Target
  5. end
  6. if delitem == nil then
  7. else
  8. itemr = delitem.Parent
  9. print("Selected Item: "..tostring(itemr))
  10. RemoveItem(itemr)
  11. end
  12. end)
  13.  
  14. function RemoveItem(SelectedPart)
  15. if SelectedPart:FindFirstChild("Owner") and SelectedPart.Owner.Value ~= nil and SelectedPart:FindFirstChild("ItemName") and SelectedPart:FindFirstChild("Type") and (SelectedPart.PrimaryPart ~= nil or SelectedPart:FindFirstChild("MainCFrame")) then
  16. game:GetService("ReplicatedStorage").Interaction.DestroyStructure:FireServer(SelectedPart)
  17. end
  18. end
Add Comment
Please, Sign In to add comment