the minimum adjustspeed im gonna use is .8
the maximum adjustspeed is gonna be 1.8
which i can use math.clamp()
but the real problem is on how im gonna calculate the x (adjustspeedvalue) im gonna use
can somebody show a sample formula for me?
for example (for more context)
the max attackspeed i will be putting is like 500 (I’ll change it if somebody suggests it)
so if i have like 1 attackspeed, adjust speed value will be somewhere in 1.83.
if i have 230 attack speed, maybe somewhere in 1.4-1.6 depending on the formula,
max attack speed (which is 500), will be 1.8 as put in the maximum value of the mathclamp on how im gonna use the :AdjustSpeed(math.clamp(x, .8, 1.8))
Not sure if I fully understand your question, but maybe look into lerping the values? Although I don’t quite understand your initial question that well.
function lerp(a, b, t)
return a + (b - a) * t
end
lerp(10, 20, 0.5) --> 15
-- t is any value between 0 and 1.
-- a & b are your minimum and maximum values respectively.
attack:AdjustSpeed(math.clamp(.8 + Data.AttackSpeed.Value / 100, .8, 1.8))
I kinda found it out already, but thanks I will try yours, and see which is better thanks!