Still have questions? Join our Discord server and get real time help.
Log in to vote

DataStore is saying that an accessory has been saved, but nothing was saved?

Asked by 7 days ago
Edited 7 days ago

So, I’ve recently completed my accessory datastore. And when I tested it, the output said that everything was saved. But when I rejoin, the accessory has not been saved and it’s gone. Any help?

Here’s the code for the data store:

local DataStoreService = game:GetService("DataStoreService") local DataStoreName = DataStoreService:GetDataStore("myDataStore") local player = game.Players.LocalPlayer game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(Character) local DominoValue ="BoolValue") DominoValue.Name = "Domino" DominoValue.Parent = player local DominoItem = game.ReplicatedStorage.Hats.Domino if DominoValue.Value == true then local Folder ="Folder") Folder.Name = "Hats" Folder.Parent = Character.Head local Head = Character.Head local New_Hat = DominoItem:Clone() New_Hat.Parent = Folder New_Hat.Position = Head.Position local Weld ="Weld") Weld.Parent = New_Hat Weld.Part0,Weld.Part1 = Head, New_Hat Weld.C0 =,1.4,0) Weld.C1 = Head.HatAttachment.CFrame end end) local data local success, errormessage = pcall(function() data = DataStoreName:GetAsync(player.UserId.."-Hats") end) if success then print("Hats loaded") else print("Error") warn(errormessage) end end) game.Players.PlayerRemoving:Connect(function(player) local success, errormessage = pcall(function() DataStoreName:UpdateAsync(player.UserId.."-Hats",function(old) local newvalue = old newvalue = player.Domino.Value return newvalue end) end) if success then print("Hats have been saved.") else warn(errormessage) end end)
I believe this is a local script thats why its not saving? WitheractiveGamer 0 — 7d
It needs to be local script because it has LocalPlayer robertruttar12 -115 — 7d

Answer this question