local DataStore = game:GetService("DataStoreService"):GetDataStore("mnaj22 level") game.Players.PlayerAdded:connect(function(player) wait() Level = player.PlayerGui.ScreenGui.Value local key = "player-" ..player.userId local savedValues = DataStore:GetAsync(key) if savedValues then Level.value = savedValues(1) else local valuesToSave = (Level) DataStore:SetAsync(key, valuesToSave) end end)
I'm not well-versed with data stores as yet, so I know I'm not the most qualified to answer this question -- but no one else is doing so. From looking at it (and checking the wiki a bit), it doesn't look as if your problem is in using the storage itself, but that you're setting your 'Level.value' to 'savedValues(1)' rather than just 'savedValues'. Not sure if I'm just misreading it.
local DataStore = game:GetService("DataStoreService"):GetDataStore("mnaj22 level") game.Players.PlayerAdded:connect(function(player) wait() Level = player.PlayerGui.ScreenGui.Value local key = "player-" ..player.userId local savedValues = DataStore:GetAsync(key) if savedValues then Level.Value = savedValues[1] else local valuesToSave = Level DataStore:SetAsync(key, valuesToSave) end end)
Few syntax mistakes. When you want to access a member of a table, use square brackets [] not parentheses ().