lets say the player has 700 stamina at max rank and 300 stamina at starting rank
how can it be the same drain for both
Do you want I write a script to get a percentage of a fraction ?
yes please do that thats what it is thanks
Here is the script! This script will print the percentage of stamina.
local percentage = startingRankStamina / maxRankStamina * 100
You can use the round function
local percentage = math.round( startingRankStamina / maxRankStamina * 100 )
trying to make it so it drains 0.7% of the stamina every like 0.3 seconds
This is easy. Try this script !
while wait(0.3) do
startingRankStamina += ( maxRankStamina / 100 ) * 0.7
end
I hope I helped you.
what if the player stamina increases everytime he ranks up
I made an error on my 2nd script?
stamina = 420
local function decreaseStamina(stamina)
local s = stamina
if math.abs(stamina*0.99) < 0.001 then
s = 0;
end
return s*0.99
end