i'm making a inventory gui whenever you click the item it finds the item based off of a boolvalue in the textbutton that has the name of the item then the script finds the name based off of the boolvalue how exactly do I do that heres my script
local player = game.Players.LocalPlayer
function onButtonClicked()
game.Lighting:FindFirstChild(""):Clone().Parent = player.Backpack
end
script.Parent.MouseButton1Down:connect(onButtonClicked)

3 comments
Line 1 does have a purpose...
so it look like game.Lighting:FindFirstChild(script.Parent.Item.Name):Clone().Parent = player.Backpack?
You may also want to make the cloned object a variable, just to clean up the code.