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

0

well, idk, what is Bags refering to?

0

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

0

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

0

Bags is a folder containing bags, and I have an attatchment and a handle in the accessory

0

hmm

0

there must be a problem to the refering then

0

check your script

0

@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.

0

I fixed it, it was a problem with the attatchment

0

But thanks for the help