Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Anyone know how to lower or change leaderstat max value?

Like this when, The max value reach, it will stop adding value it remains the same.

I try like this and nothing happens lol anyone know please help thanks!

1 while wait(1) do

2 if (player.leaderstats.Money.Value > 1100)then

3 player.leaderstats.Money.Value = 1100

4 end

5 end

First time to post here haha

2 answers

Please use code blocks. And wrap this in a changed event.

local money = player.leaderstats.Money

money.Changed:Connect(function(prop)
    if money.Value > 1100 then
        money.Value = 1100
    end
end)

There’s a useful thing called “break” which allows you to break and stop a loop.

Here’s an example on how to use it :

a = 0

while wait(1) do
     if a >= 10 then
          break
     else
          a = a + 1
     end
end

This script adds up a value by 1, and when it gets to 10 or more, it breaks. Otherwise it keeps adding up. Also note that “break” must be IN the loop to work.

This discussion is preserved as it was. New answers, comments, and votes are closed.