so when they click the button it sells the item and removes it from their backpack and startergear, however it seems in the real server (not studio) it removes the tool from the backpack but cant remove from the startergear. it says it returns nil.

please help, and thank you.

	newslot.MouseButton1Click:connect(function() -- does this when clicked
		local lookforname = player.Backpack:FindFirstChild(tools[i].Name) -- looks for the tool name in backpack
		if lookforname then -- once it finds the tool it adds the sell value to the players gold
			player.leaderstats.Gold.Value = (player.leaderstats.Gold.Value) + (tools[i].sellPrice.Value)
			newslot:Destroy()
			local item2destroyfromBackpack = player.Backpack:FindFirstChild(tools[i].Name)
			item2destroyfromBackpack:Destroy()
			local item2destroyfromStarterGear = player.StarterGear:FindFirstChild(tools[i].Name)
			item2destroyfromStarterGear:Destroy()

2 comments

0

I believe they changed the name to StarterPack

0

well, the StarterPack goes to every player on the server's backpack, im only looking to remove it from the one player who sold the item