So I've been making this custom inventory for the past week. So far the progress is good, but this error that really confuses me prevents me from continuing to develop the inventory. "Players.BiIinear.PlayerGui.Inventory.Frame.SlotFrame.Slot01.LocalScript:8: attempt to index local 'clicked' (a number value)" I'm not even sure how clicked, the player that fired the script can turn out to be a number value...
wait(5)
local item = script.Parent.ItemNameValue.Value
local player = game.Players.LocalPlayer
--Equip
script.Parent.MouseButton1Down:Connect(function(clicked)
if script.Parent.ItemNameValue.Value ~= 'nil' then
local tool = clicked.Backpack[script.Parent.ItemNameValue.Value]
clicked.Character.Humanoid:EquipTool(tool)
else
end
end)
'ItemNameValue.Value' means the name of the item in the slot. Any help would be greatly appreciated. Like I said, this makes no sense to me.

3 comments
shut up incapoop u nrd
nerd nerd nerd nerd nerd
Incapaxx, thanks. I was really tired that day. Also, who are these 2 trolls? Why are they allowed on this platform?