I have a status effect system and I want some effects to increase or decrease a number by a percent for example I have a poison effect that I want to make decrease the player’s movement speed by 10%.
I made this function
-- to decrease just make percent a negative number.
function Utils:IncreaseNumByPercent(number : number, percent : number)
local result = math.floor(number * (1 + (percent/100)))
return result
end
but I’m not entirely sure if this is actually how you calculate this.