Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
test3
local health = 50 local maxHP = 100 local hp_diff = (maxHP - health) local reps = math.max(1, math.floor(hp_diff / 10)) local inc_hp = math.ceil(hp_diff / 2) print(reps, inc_hp) function math.Approach( cur, target, inc ) inc = math.abs( inc ) if ( cur < target ) then return math.min( cur + inc, target ) elseif ( cur > target ) then return math.max( cur - inc, target ) end return target end for k = 1, reps do health = math.Approach(health, maxHP, inc_hp) end print(health)
run
|
edit
|
history
|
help
-1
Dirty Bag 'o Tokens Maker
RSA KEY GENERATOR (LUA)
sh
ROBLOX Ui Play Button
Show current system clock
10 Line challenge
Fibonacci in Lua (Inspired)
Monty Hall
BasicTablePrinterV2
PAID HACK PuBG