Trying to make so that a part gives a gun when you click on it. Doesn't appear to be working as it either gives me all the guns in lightning or none.
function onClick(click) for i,v in pairs (game.Lighting:GetChildren()) do if v.ClassName == "Tools" then c = v:Clone() c.Parent = click.Backpack end end end script.Parent.ClickDetector.MouseClick:connect(onClick)

1 comment
Use a code block next time to display code.