local DataStore = game:GetService("DataStoreService"):GetDataStore("StoreName")game.Players.PlayerAdded:connect(function(player)
local key = "key-"..player.userId
local folder = Instance.new("Folder",player)
folder.Name = "leaderstats"
local currency1 = Instance.new("Folder",player)
folder.Name = "leaderstats"
local currency1 = Instance.new("IntValue",folder)
currency1.Name = "Money"
local save = DataStore:GetAsyncz(key)
if save then
currency1.Value = save[1]
else
local load = {currency1.Value}
DataStore:SetAsync(key,load)
end
end)game.Players.PlayerRemoving:connect(function(player)
local key = "key-"..player.userId
local load = {player.leaderstats:FindFirstChild("Name").Value}
DataStore:SetAsync(key,load)Script Number=2 (Which is inside of StarterGui):local player = script.Parent.Parent
local leaderboard = player:WaitForChild("leaderstats")
local currency1 = leaderboard:WaitForChild("Name")while wait(5) do
currency1.Value = currency1.Value + 1
end?
Also if this script have any promblems please do me a favor and tell me thx :) ps: i am new in this scripting thingy so forgive my scripting skills :)

4 comments
check like 10.
Why do you have a while loop in the PlayerRemoving event o.o
There is no silent Z in GetAsync
You also need spaces on line 20 “ = “