My Currency Increase Script Is not working anybody know why?
The script:
amount = 1 -- value given
timedelay = 1 -- time before value given
currencyname = "Time"-- Name of value
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 + 1
end
end
end

7 comments
I recommend using the (recently added) += operator to add onto the same value in memory, skipping the need to rewrite it entirely. Other than that nitpick, please show any potential error messages. Thanks!
if there was an error message he would have stated it. Not stating it is against the rules ^
The += operator does the exact same thing as val = val + 1, it was only included as a long requested QoL update.
You clearly taken it from alvin blox
@misha123 Considering he just joined today at the time of posting, I can't expect them to be completely familiar with the ins and outs of the rules.
Yea sorry i didn't add the error i didn't know here it is: 19:01:33.723 - ServerScriptService.Script:9: attempt to perform arithmetic (add) on boolean and number
@JasiuJasiuB yea because i couldn't figure out the problem after a hour