game.Players.PlayerAdded:Connect(function(plr)
local a = Instance.new("Folder",plr)
a.Name = "leaderstats"
local m = Instance.new("IntValue",a)
m.Value = 0
m.Name = "Cash"
local x = Instance.new("IntValue",a)
x.Value = 0
x.Name = "Bananas"
local r = Instance.new("IntValue",a)
r.Value = 0
r.Name = "Rebirths"
local r = Instance.new("IntValue",plr)
r.Value = 5
r.Name = "wait"
end)
while true do
wait(1)
for i, v in pairs(game.Players:GetChildren()) do
if v:FindFirstChild("leaderstats") ~= nil then
if v.leaderstats:FindFirstChild("Bananas") ~= nil then
v.leaderstats.Bananas.Value = v.leaderstats.Bananas.Value end
end
end
end
COMMUNITY QUESTION
Is there a way to make this leaderboard save?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
I can't help if you don't explain the issue..
Im trying to make the values rebirth, Cash and Bananas save their value when the player leaves and rejoins. How do i incorporate that into this script?
https://developer.roblox.com/articles/Data-store
Im having trouble adding datastore with the values in the script