-
When I tried doing things on my own I have a weird error?
-
The data isn’t printing right, or is it? Whenever I go to the console I see the last values
like:{ Coins = 100, Health = 90, Hunger 40}
but when I change it it doesn’t print the exact data I changed. -
Any Help?
Script:
local dss: DataStoreService = game:GetService(‘DataStoreService’)
local ds: DataStore = dss:GetDataStore(‘ClientData’)local serverstorage: ServerStorage = game:GetService(‘ServerStorage’)
game:GetService(‘Players’).PlayerAdded:Connect(function(player) – OnPlayerJoin
local data = ds.GetAsync(ds, player.UserId)
local succs = true
if not succs then player:Kick(“Server Couldn’t Load Data”) return end
for _, folder in serverstorage:FindFirstChild(‘ClientData’):GetChildren() do
local dupfolder = folder:Clone() dupfolder.Parent = player
end
print("Loaded Data: ", data)
end)game:GetService(‘Players’).PlayerRemoving:Connect(function(player) – OnPlayerLeaving
local datatab = {Coins = 100, Aids = 90, Health = 90}
local data = ds:SetAsync(player.UserId, datatab)
print("Saved Data: ", data)
end)`