I need help with changing this code so it raises 1 point every 15 seconds from when the player joins, not every 15 seconds the server is active and to make it so people in a certain group with a certain role will get a point raise, not guests:
amount = 1
timedelay = 15
currencyname = "Points"
while true do
wait(timedelay)
for i,v in pairs(game.Players:GetPlayers()) do
if v:FindFirstChild("leaderstats") and v then
v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + amount
end
end
end

2 comments
What is the name of the leaderstat currency, is it points?
Points is the currency.