-- Save
if v.Name == 'Mailbox' then
local MailboxData = {}
local Position = PlayersExterior.PrimaryPart.CFrame:inverse() * v.PrimaryPart.Position
local Direction = v.PrimaryPart.CFrame.lookVector
MailboxData = {
Position.X,
Position.Y,
Position.Z,
Direction.X,
Direction.Y,
Direction.Z
}
Items.Exterior['Mailbox'] = MailboxData
end
-- Load
-- Set the players mailbox
if HouseFolder.Exterior:FindFirstChild('Mailbox') then
local Mailbox = HouseFolder.Exterior.Mailbox
local Position = PlayersInterior.PrimaryPart.CFrame * Vector3.new(Mailbox[1].Value, Mailbox[2].Value, Mailbox[3].Value)
local LookVector = Vector3.new(Mailbox[4].Value, Mailbox[5].Value, Mailbox[6].Value)
PlayersExterior.Build.Mailbox:SetPrimaryPartCFrame(CFrame.new(Position, Position + (LookVector * 5)))
end
It’s definately saving as when I join it has the saved data there. So it’s a problem with the load. I basically have a PrimaryPart inside the Mailbox, and trying to use that as the position.
Where mailbox is by default
Where the mailbox ends up being loaded when I rejoin (house has loaded in a differnet plot
It should position base on the bases primary part. All bases have a primary part at the front centre of the plot. This is all positions of the house are saved respective of the bases primary part, so no matter the orientation of the house, it stays a constant