Changing cframe depending on house position

Whilst you’re saving the CFrame of the object, be sure to make it relative via finding the inverse of the house’s base. Egomoose did this rather well in his placement system.

--Example Code (for saving the position)
local position = plrHouse.Base.CFrame:inverse() * Object:GetPrimaryPartCFrame()
--Example Code (for loading)
local components = {}

for num in string.gmatch(cf, "[^%s,]+") do
	components[#components+1] = tonumber(num)
end

Object:SetPrimaryPartCFrame(plrHouse.Base.CFrame * CFrame.new(unpack(coms)))
1 Like