Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Does any one know how to lower a leaderstat max?

Asked by 7 years ago

My game needs a max for some leaderstats the stats are Level and EXP. The max for level is 50 and the max for EXP is 50,000.

thanks

0
Well, you can just have a .Changed event. And then if they have higher than a specific value, you just tell them what happened, and then just take them back to the max value. adrrob1002 5 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Simple solution? Create something like

while wait() do
if (level.Value > 50) then
    level.Value = 50
else if (EXP.Value > 50000) then
    EXP.Value = 0
end
end

Keep in mind using raw leaderstats is easily exploitable and might allow for someone, if they really wanted to, to cheat to the top of your game with ease. You can look on the wiki for ways to fix this if this is something you might worry about.

--Scripting Helpers wants you to try-- By this I mean don't just ask for the answer to a question or straight up for a script to do something. This isn't a place to request scripts it's a place for help so next time just show that you actually tried or you will be marked with more negative rep. ;)

0
thanks bobsville2000 -7 — 7y
0
A more efficient way to do this would be using a Changed event.   Programical 653 — 7y
Ad

Answer this question