Help with Simple Mathematic!

Help with Simple Mathematic!

if ((MaxItem-IA) >= (Lerp(MaxItem,0,0.8))) and ((MaxItem-IA) <= (Lerp(MaxItem,0,1))) then
		ModulusAVG = 6
	elseif ((MaxItem-IA) >= (Lerp(MaxItem,0,0.7))) and ((MaxItem-IA) <= (Lerp(MaxItem,0,0.8))) then
		ModulusAVG = 5
	elseif ((MaxItem-IA) >= (Lerp(MaxItem,0,0.55))) and ((MaxItem-IA) <= (Lerp(MaxItem,0,0.7))) then
		ModulusAVG = 4
	elseif ((MaxItem-IA) >= (Lerp(MaxItem,0,0.4))) and ((MaxItem-IA) <= (Lerp(MaxItem,0,0.55))) then
		ModulusAVG = 3
	elseif ((MaxItem-IA) >= (Lerp(MaxItem,0,0.2))) and ((MaxItem-IA) <= (Lerp(MaxItem,0,0.4))) then
		ModulusAVG = 2
	elseif ((MaxItem-IA) >= (Lerp(MaxItem,0,0))) and ((MaxItem-IA) <= (Lerp(MaxItem,0,0.2))) then
		ModulusAVG = 1
	else
		ModulusAVG = 6 print("Unknown Grade")
	end

Its a bit complex, Ignore MoulusAVG, its for a grade Table, the problem is not with that!
It is not the LerpFunction, I hope!

Ok anyway, I want to compare however many Items a player has to however many Items you can get altogether! However it is not wokring!
In the code above, I use this:
((MaxItem-IA) >= (Lerp(MaxItem,0,0.8))) and ((MaxItem-IA) <= (Lerp(MaxItem,0,1)))
Cleaner:

Difference or All Item and Amount of Item Player haz >= Eighth of Maximum Itemz
and
Difference or All Item and Amount of Item Player haz <= Maximum Itemz

How do i go about doing this, I know its simple but I just cant do it! Help

EDIT: The code works fine (NO ERROR), just not as intended!

Can you show a screenshot or two of what you are using it for and what it looks like that is ‘wrong’ ?

1 Like

OH, I might delete this post, it works fine but I added a limit to how many items you can get, therefore you could never get to some code! Thankz!
Here an IMAGE of what I used it for
image
ModulusAVG is 1 to 6, Grade A to F
THX!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.