Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to make this leaderboard save?

Asked by 5 years ago
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
0
I can't help if you don't explain the issue.. CaptainAlien132 225 — 5y
0
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? Narrowlegobricks 12 — 5y
0
Im having trouble adding datastore with the values in the script Narrowlegobricks 12 — 5y

Answer this question