#is there any better way? :(
1 messages · Page 1 of 1 (latest)
But idk any of them
Ty i guess lol
@nimble estuary https://devforum.roblox.com/t/how-to-optimize-code-when-theres-too-many-else-if-s/694699
Np
TakeDamage(math.ceil(health / maxhealth * 10))
this is close to what you want but not the same if it has to be the same then you have to do
local damages = {1, 1, 2, 3, 4, 5, 5, 6, 10, 11}
TakeDamage(damages[math.ceil(health / maxhealth * 10)])