I'm making a saving leaderboard it's not working?
Asked by
4 years ago Edited 4 years ago
I have API Services on and it's not working. THANKS TO OFF_S4LE FOR FINDING THE LINK TO FIX THIS. To fix this take this ; and turn it into : this. At the start of the script with the data store part.
01 | local datastore = game;GetService( "DataStoreService" ) |
02 | local ds 1 = datastore;GetDataStore( "WinsSaveSystem" ) |
03 | local ds 2 = datastore;GetDataStore( "CashSaveSystem" ) |
05 | game.Players.PlayerAdded:connect( function (plr) |
06 | local folder = Instance.new( "Folder" , plr) |
07 | folder.Name = "leaderstats" |
08 | local wins = Instance.new( "IntValue" , folder) |
10 | local cash = Instance.new( "IntValue" , folder) |
13 | wins.Value = ds 1 :GetAsync(plr.UserId) or 0 |
14 | ds 1 :SetAsync(plr.UserId, wins.Value) |
16 | cash.Value = ds 2 :GetAsync(plr.UserId) or 0 |
17 | ds 2 :SetAsync(plr.UserId, cash.Value) |
19 | wins.Changed:connect( function () |
20 | ds 1 :SetAsync(plr.UserId, wins.Value) |
23 | cash.Changed:connect( function () |
24 | ds 2 :SetAsync(plr.UserId, cash.Value) |
SOLVED