Destroying everything in Plr Backpack

  1. What do you want to achieve? Keep it simple and clear!
    I wanna destroy everything in Plr Backpack with clicking button

  2. What is the issue? Include screenshots / videos if possible!
    Getting an error.
    image

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tryed get all BP children

Script:

local Button = script.Parent
local Player = game.Players.LocalPlayer
local PlayerBP = Player.Backpack
local Guns = PlayerBP:GetChildren()
Button.MouseButton1Click:Connect(function()
Guns:Destroy()
end)
1 Like

Try this

local Button = script.Parent
local Player = game.Players.LocalPlayer
local PlayerBP = Player.Backpack

Button.MouseButton1Click:Connect(function()
   PlayerBP:ClearAllChildren()
end)
1 Like

Thanks, that works. (30 letters)

1 Like