[Answered] Datastore won't save CFrame?
Asked by
4 years ago Edited 4 years ago
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?
01 | game.Players.PlayerRemoving:Connect( function (Player) |
02 | print ( 'Saving Data For Player ' .. Player.Name) |
06 | local BuildsValue = { } |
08 | for i,v in pairs (game.Workspace.truc.PlacedObject:GetChildren()) do |
09 | local cframe = v:GetPrimaryPartCFrame() |
11 | local New = { [ 'Object' ] = v.Name, [ 'CFrameVal' ] = cframe, [ 'I' ] = v.WhereVal.Value } |
12 | table.insert(BuildsValue,New) |
15 | local BuildEncode = HS:JSONEncode(BuildsValue) |
16 | PlrDS:SetAsync( "Builds-" ..Player.UserId,BuildEncode) |