Can someone help me with my leader board script

all the scripts are in server script service

Leaderboard script:

game.Players.PlayerAdded:connect(function(plr)
local stats = Instance.new(“BoolValue”,plr)
stats.Name = “leaderstats”

local Love = Instance.new("IntValue",stats)
Love.Name = "Love"
Love.Value = 0

end)

the script that gives the points to the player each second:

amount = 2 – this varibel is the amount of love we get each time
timedelay = 4 – this varibeble is the amount of seconds inbetween each time the cash reward
currencyname = “Love” – this is name of our curaency

while true do
wait(timedelay)
for i,v in pairs(game.Players:GetPlayers()) do
if v:FindFirstChild(“leaderstats”) then
v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + Amount
end
end
end

1 Like
game.Players.PlayerAdded:connect(function(plr)
local stats = Instance.new(“Folder”,plr)
stats.Name = “leaderstats”

local Love = Instance.new("IntValue",stats)
Love.Name = "Love"
Love.Value = 0

end)

This should be your leaderstats script.

1 Like

I dont think this should be a boolValue, Instead it should be a folder

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.