Is this the best way to give levels?

I have this LevelUp code:

Exp:GetPropertyChangedSignal("Value"):Connect(function()
	local formulate = 500 * (Level.Value + 1)
	MaxExp.Value = formulate
		
	if Exp.Value > MaxExp.Value then
		local getRemaining = Exp.Value - MaxExp.Value
		Level.Value += 1
		Exp.Value = getRemaining
	elseif Exp.Value == MaxExp.Value then
		Level.Value += 1
		Exp.Value = 0
	end
end)

But I don’t know if this is the best way to give levels for a player? Any tips/suggestions for the equation of leveling up code?

What are you looking for? Do you want it to increase by the same amount each level or do you want it to increase by more each time. Something like this would increase the amount by more and more each time.

Also there is no need to check if the Exp.Value == MaxExp.Value, if they are equal then the first if statement will just set the exp to 0 anyway.

Exp:GetPropertyChangedSignal("Value"):Connect(function()
	local formulate = math.floor((Level.Value)^1.1 * 100) * 5
	MaxExp.Value = formulate
		
	if Exp.Value > MaxExp.Value then
		local getRemaining = Exp.Value - MaxExp.Value
		Level.Value += 1
		Exp.Value = getRemaining
	end
end)
2 Likes