why is my game not auto saving the wins?
hi scripter,
so, ive just made a auto save and leaderboard (on top of screen)
But the save does not save...
If you want to see it, here you go!
https://www.roblox.com/games/722511272/Jumpy-racing-Under-construction
But what am I doing wrong?
leaderboard
1 | game.Players.PlayerAdded:connect( function (plr) |
2 | local stats = Instance.new( 'IntValue' , plr) |
3 | stats.Name = 'leaderstats' |
4 | local Points = Instance.new ( 'IntValue' , stats) |
OrderedDataStore AutoSave
01 | local DSService = game:GetService( 'DataStoreService' ):GetDataStore( 'Hamburger223232' ) |
02 | game.Players.PlayerAdded:connect( function (plr) |
04 | local uniquekey = 'id-' ..plr.userId |
05 | local leaderstats = Instance.new( 'IntValue' , plr) |
06 | local savevalue = Instance.new( 'IntValue' ) |
07 | leaderstats.Name = 'leaderstats' |
08 | savevalue.Parent = leaderstats |
09 | savevalue.Name = 'Wins' |
12 | local GetSaved = DSService:GetAsync(uniquekey) |
14 | savevalue.Value = GetSaved [ 1 ] |
16 | local NumbersForSaving = { savevalue.Value } |
17 | DSService:SetAsync(uniquekey, NumbersForSaving) |
21 | game.Players.PlayerRemoving:connect( function (plr) |
22 | local uniquekey = 'id-' ..plr.userId |
23 | local Savetable = { plr.leaderstats.Wins.Value } |
24 | DSService:SetAsync(uniquekey, Savetable) |
I hope you can help me out!
thanks!
good luck with other scripting!
-Gamer_io