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

How to make an max amout of value in a leaderboard?

This is an small part of an huge script (Leaderboard) but my question is how to let people don't get an higher amout of money then the limit that in cause is 2145000000. If their is an otherway then the

if Tix.Value >= Max then
		if newPlayer.userId then
				Tix.Value = Max
			end
		end

It will may easier and better.

local Max = 2145000000
function onPlayerEntered(newPlayer)
local Tix= Instance.new("IntValue")
		Tix.Name = "Tix"
		Tix.Value = 0
		if Tix.Value >= Max then
		if newPlayer.userId then
				Tix.Value = Max
			end
		end
end
		

Thanks

2 answers

✓ Accepted answer

You can actually use the IntConstrainedValue to to accomplish this. It has properties you can set to keep its value between two numbers.

I believe there is no other way than a script. Yet, the script can check the value everytime it changes, this way

value = Instance.new("IntValue")

value.Changed:connect(function()
	-- max value code
end)

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