Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I'm making a saving leaderboard it's not working?

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.

local datastore = game;GetService("DataStoreService")
local ds1 = datastore;GetDataStore("WinsSaveSystem")
local ds2 = datastore;GetDataStore("CashSaveSystem")

game.Players.PlayerAdded:connect(function(plr)
 local folder = Instance.new("Folder", plr)
 folder.Name = "leaderstats"
 local wins = Instance.new("IntValue", folder)
 wins.Name = "Wins"
 local cash = Instance.new("IntValue", folder)
 cash.Name = "Cash"
 
 wins.Value = ds1:GetAsync(plr.UserId) or 0
 ds1:SetAsync(plr.UserId, wins.Value)
 
 cash.Value = ds2:GetAsync(plr.UserId) or 0
 ds2:SetAsync(plr.UserId, cash.Value)
 
 wins.Changed:connect(function()
  ds1:SetAsync(plr.UserId, wins.Value)
 end)
 
 cash.Changed:connect(function()
  ds2:SetAsync(plr.UserId, cash.Value)
 end)
end)

SOLVED

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.