itemType is not a valid member of tool

I keep getting this error and im not sure why, ive tried using waitforchild but it did nothing, only infinite yield

slot.ItemType.Value = child.ItemType.Value


Screen Shot 2021-04-18 at 11.10.04 AM

Maybe that value was created on the client, and that error is from the server?

Is the error coming from a ServerScript or a LocalScript?

Can you show more of the script? Can you show us were the error originates?

local slot = repStorage.Templates.Template:Clone()

local equipMen = script.Parent.Parent.Parent.EquipMenu



inventory.ChildAdded:Connect(function(child)
	print("Item Received "..child.Name)
	
	slot.Name = child.Name
	slot.Parent = script.Parent
	slot.ItemName.Value = child.Name
	slot.ItemType.Value = child.ItemType.Value
end)

what do you mean?

what is slot???

Aeventy is asking if your script is a LocalScript or a Script.

To trouble shot your problem, Iā€™d recommend trying this code:

local slot = repStorage.Templates.Template:Clone()

local equipMen = script.Parent.Parent.Parent.EquipMenu

inventory.ChildAdded:Connect(function(child)
	print("Item Received "..child.Name)
	print(child:GetChildren()) 
-- Then you can check if the child exists by reading the table in the output.
-- If the child doesn't exist, the problem is probably in a different section of your code.
-- I'd recommend looking on the server and client to see if the value instance exists on both.
-- Also check code that reparents/deletes children of the tool
	slot.Name = child.Name
	slot.Parent = script.Parent
	slot.ItemName.Value = child.Name
	slot.ItemType.Value = child.ItemType.Value
end)
1 Like