basically most of my scripts use Humanoid:TakeDamage()
But is there a way i can get some damage resistance on a character or something easily?
basically most of my scripts use Humanoid:TakeDamage()
But is there a way i can get some damage resistance on a character or something easily?
Sure thing!
local damage = 100
local res = 20 --basically a percentage of damage you want to be taken instead
Humanoid:TakeDamage(damage * res/100) --in this case 20/100 is 0.2, so 100*0.2 is 20 damage taken
If the damage would be 639 and res would be 13, then the actual damage you’d get is 13 percent of 639, which is 639 * 13/100 = 83.07 Health Points, and so on.
You can always play with it,
--Settings
local Damage = 100
local Resist = 5
--Inside a code
Humanoid.Health -= (Damage * Resist/100) --> in this case, it'd be: 100*5/100, which is 5.
There are apparently various ways to do that. This is only a very basic one.