I’m trying to tell the server where to place a model. The model is in one spot on the client, but on the server, is offset for whatever reason. I’m sending the model’s PrimaryPartCFrame() with GetPrimaryPartCFrame() through a RemoteEvent, like this:
event:FireServer(item:GetPrimaryPartCFrame())
And then, on the server, make a new item and set its CFrame like this:
event.OnServerEvent:connect(function(plr, cframe)
--Pretend item exists for the sake of clarity
item:SetPrimaryPartCFrame(cframe)
end)
I see no reason why the item is offset. I’ve tried just reading the primary part’s CFrame the old-fashioned way (primarypart.CFrame) to no avail.
That was a good idea. Unfortunately the CFrame being received is the same as the one being sent.
Here’s my full code. Maybe there’s something here I’m missing?
events:WaitForChild("PlaceItem").OnServerEvent:connect(function(plr, itmname, cframe, pcolor, scolor)
if true then --Add checks here later.
local item = game.ReplicatedStorage.Furniture:FindFirstChild(itmname)
if item then
print(cframe)
item = item:Clone()
item.Colors.PrimaryColor.Value = pcolor
item.Colors.SecondaryColor.Value = scolor
item.PrimaryPart = item.Primary
item:SetPrimaryPartCFrame(cframe)
item.Parent = game.Workspace
end
end
end)