Why can only one Player see the Trading Frame?

I want to be able to trade my Items from the Inventory but when the TradingFrame openes it only shows for 1 peerson and that’s because I changed Backpack to Inventory in tzhe small script Ima show now and it gives me an error:

Model:SetPrimaryPartCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this.

local config = {}


-------Settings you can change-------
config.MaxSlots = 6
config.TimeBeforeTradeConfirmed = 5
-------------------------------------


--Funcion for getting all the tools a player has
function config.GetTools(plr)
	
	local plrTools = plr.Inventory:GetChildren()

	local toolEquipped = plr.Character:FindFirstChildOfClass("Tool")
	if toolEquipped then
		table.insert(plrTools, toolEquipped)
	end

	return plrTools
end

return config














and this is the part of the error:

toolModel.PrimaryPart = toolModel:FindFirstChild("Handle") or toolModel:FindFirstChildOfClass("BasePart", true)
				toolModel:SetPrimaryPartCFrame(CFrame.new(0, 0, -3))

You need to send a remoteevent back to the server and fire it to the other client who has been offered the trade. In case of exploiters, you should also do transactions like this on the server, and the transactions wont even exist to the server if its not done in this way

1 Like

You are setting the toolModel’s primary part to

toolModel:FindFirstChild("Handle") or toolModel:FindFirstChildOfClass("BasePart", true)

Which is probably returning nil, making the toolModel not have a primary part.
But the model needs to have a primary to use :SetPrimaryPartCFrame() since this function tries to change the CFrame of the primary part.

At least that’s the reason for the error.

I mean I got a remote event in the same parent as the first script