if Data then
local Tool = Tools:FindFirstChild(Data[1])
Tool:Clone().Parent = player:WaitForChild("StarterGear")
if not player:WaitForChild("Backpack"):FindFirstChild(Tool.Name) then
Tool:Clone().Parent = player:WaitForChild("Backpack")
end
ToolB.Value = Tool.Name
Cash.Value = Data[2]
local Bag = Bags:FindFirstChild(Data[3])
Char.Humanoid:AddAccessory(Bag) -- Errors here
BagB.Value = Bag.Name
Inbag.Value = Data[4]
Maxbag.Value = Data[5]
else
local Tool = Tools:FindFirstChild("Coin")
Tool:Clone().Parent = player:WaitForChild("StarterGear")
if not player:WaitForChild("Backpack"):FindFirstChild(Tool.Name) then
Tool:Clone().Parent = player:WaitForChild("Backpack")
end
ToolB.Value = Tool.Name
Cash.Value = 100
local Bag = Bags:FindFirstChild("Basic")
Char.Humanoid:AddAccessory(Bag) -- Errors Here
BagB.Value = Bag.Name
Inbag.Value = 0
Maxbag.Value = 5
end
It errors saying AddAccessory needs to be passed a valid accessory Object but the Bag is an accessory?

10 comments
well, idk, what is Bags refering to?
Is "Bags" a Folder or Model that contains the Accessory? Also the accessory, when added to the player must contain both an Attachment and a Handle
yah thats true, but if it doesnt have one of those it will get added but it wont work, his accessory isnt getting parented in our case
Bags is a folder containing bags, and I have an attatchment and a handle in the accessory
hmm
there must be a problem to the refering then
check your script
@Professional, go back to wherever you pre-defined "Bags" and make sure that the variable's definition matches the location of "Bags". Also, if "Bags" is in ServerStorage and you're running this from the Client, it will not replicate either.
I fixed it, it was a problem with the attatchment
But thanks for the help