I made this script which waits 60 seconds, then increases a leaderstat value by 1. But for some reason nothing happens to the value, and I don't get any errors on it. I feel like the answer is obvious but I have no idea how to fix it. Here's the code:
wait(1.5)
function Min(NP)
while true do
local Stat = NP.leaderstats["Minutes Played"].Value
wait(60)
Stat = Stat + 1
end
end
game.Players.ChildAdded:Connect(Min)
I've also tried making it a StarterPlayerScripts script and the same thing happens, code below.
wait(2)
while true do
wait(6)
script.Parent.Parent.leaderstats["Minutes Played"].Value =
script.Parent.Parent.leaderstats["Minutes Played"].Value +1
end

1 comment
Local Scripts only change to Local Player... you should use a normal script