--why did we make a duplicate????
--[[game.ReplicatedStorage.RemoteFunctions.PurchasePermanentItem.OnServerInvoke = function(plr,itemid)
	local data = game.ReplicatedStorage.PlayerData:FindFirstChild(plr.userId)
	local obj = game.ServerStorage.RemoteFunctions.GetObjectFromID:Invoke(itemid)
	if data and obj then
		for _,v in pairs(data.Objects:GetChildren()) do
			if v.Name == obj.Name then
				return false,"You already own this item! Please choose another one."
			end
		end
		local costdiff = obj.ItemCost.Value - data.cash.Value --how much more they need
		if costdiff > 0 then
			return "cash",costdiff
		end
		game.ServerStorage.RemoteFunctions.ChangeCash:Fire(plr,-obj.ItemCost.Value)
		game.ServerStorage.RemoteFunctions.AwardItem:Fire(plr,obj.ItemID.Value)
		return true
	end
end

game.ReplicatedStorage.RemoteFunctions.PurchaseTemporaryItem.OnServerInvoke = function(plr,shopname,itemname)
	local shop = game.ServerStorage:FindFirstChild(shopname)
	local data = game.ReplicatedStorage.PlayerData:FindFirstChild(plr.userId)
	if shop and data then
		local item = shop:FindFirstChild(itemname)
		if item then
			local costdiff = item.ItemCost.Value - data.cash.Value
			if costdiff > 0 then
				return "cash",getCashNeeded(costdiff)
			end
			local backpack = plr:FindFirstChild("Backpack")
			if backpack and #backpack:GetChildren() < 10 then --backpack items later!!
				game.ServerStorage.RemoteFunctions.ChangeCash:Fire(plr,-item.ItemCost.Value)
				local tool = item.Tool:clone()
				tool.Name = item.Name
				tool.Parent = backpack
				return true
			else
				return false,"You can't hold any more items! Press Backspace to drop items, or purchase a Backpack which can hold more items."
			end
		end
	end
end]]