I made a table which includes weapons. When the parent of this script is clicked, I want to remove these tool(s) if they are present inside of the player in workspace. When I press the button, nothing happens. I'm new to tables so help would be appreciated.
local player = game.Players.LocalPlayer
local character = player.Character
function onClick()
local weapons = {
[character.M14] = "M14",
[character.G36K] = "G36K",
[character.Patriot] = "Patriot",
}
if character:FindFirstChild(weapons) then
weapons:Destroy()
end
end
script.Parent.MouseButton1Down:connect(onClick)

1 comment
The only way that I can think of is actually listing all of the weapons as different variables, but that will take too long.