I want to remove these weapons when I click the parent of this script. It attempted to index local 'player' (a number value)?
local player = game.Players.LocalPlayer
local weapons = {
"AK-104",
"AK-12",
"AK-47",
"AK-74",
"AKM",
"AKS-74U",
"AN-94",
"Auto-5",
"CBJ-MS",
"CZ-75",
"Enfield",
"FAL",
"Federov",
"G18",
"G3",
"G36K",
"G37",
"HK417",
"M1 Garand",
"M1014",
"M14",
"M1911",
"M249",
"M3",
"M4A1",
"M870",
"M9",
"M93R",
"MP5",
"Makarov",
"Maverick",
"Mk 17",
"Mk 23",
"Mk 48",
"Model 459",
"Mosin-Nagant",
"OTs-14",
"PP-19",
"Patriot",
"RPK",
"Revolver",
"SCAR-L",
"SKS",
"Shotgun",
"TEC-9",
"USP45",
"Uzi"
}
function onClick(player, weapons)
--return player.Backpack:findFirstChild(weapons) and player.Character:findFirstChild(weapons)
if player.Backpack:findFirstChild(weapons) then
weapons:Destroy()
elseif player.Character:findFirstChild(weapons) then
weapons:Destroy()
end
end
script.Parent.MouseButton1Down:connect(onClick)
