Hello, I was having a issue with the datastores. I wanted to save my model primary part CFrame, but when I go to the game again, the CFrameVall is null. Any idea how to fix this issue?
game.Players.PlayerRemoving:Connect(function(Player) print('Saving Data For Player '.. Player.Name) -- Builds local BuildsValue = {} for i,v in pairs(game.Workspace.truc.PlacedObject:GetChildren()) do local cframe = v:GetPrimaryPartCFrame() print(cframe) local New = {['Object'] = v.Name, ['CFrameVal'] = cframe, ['I'] = v.WhereVal.Value} table.insert(BuildsValue,New) end local BuildEncode = HS:JSONEncode(BuildsValue) PlrDS:SetAsync("Builds-"..Player.UserId,BuildEncode) end)
Hello, I found out how! I just needed to put the CFrame in a table just like this:
{cframe:GetComponents()}
and then to get it back just do this:
table.unpack(cframe)
Hope this helped someone!