I have tried so many data save methods and NONE of them work for me. Hopefully you guys will be able to help.
01 | GemsStore = game:GetService( "DataStoreService" ):GetDataStore( "DataStore" ) |
02 |
03 |
04 | game.Players.PlayerAdded:connect( function (plr) |
05 | local stats = Instance.new( 'Folder' , plr) |
06 | stats.Name = 'leaderstats' |
07 | local Gems = Instance.new( 'IntValue' , stats) |
08 | Gems.Name = 'Gems' |
09 | Gems.Value = GemsStore:GetAsync(plr.UserId) or 0 |
10 |
11 | if GemsStore:GetAsync( "Points_" ..plr.Name) ~ = nil then |
12 | Gems.Value = GemsStore:GetAsync( "Points " ..plr.Name) |
13 | else |
14 | Gems.Value = 0 |
15 | end |
Should work now. You had SetAsync and GetAsync with different names liek 'points_name' or 'points name' etc. Make sure in your configuration in your place you should have Save API enabled.
01 | GemsStore = game:GetService( "DataStoreService" ):GetDataStore( "DataStore" ) |
02 |
03 |
04 | game.Players.PlayerAdded:connect( function (plr) |
05 | local stats = Instance.new( 'Folder' , plr) |
06 | stats.Name = 'leaderstats' |
07 | local Gems = Instance.new( 'IntValue' , stats) |
08 | Gems.Name = 'Gems' |
09 | Gems.Value = GemsStore:GetAsync( "Points_" ..plr.Name) or 0 |
10 |
11 | if GemsStore:GetAsync( "Points_" ..plr.Name) ~ = nil then |
12 | Gems.Value = GemsStore:GetAsync( "Points_" ..plr.Name) |
13 | else |
14 | Gems.Value = 0 |
15 | end |