A couple of friends and I are making a game, and the coder is having problems with something. He is trying to create if you have armor on, you are resistance to damage. Here is the script he sent me:
local tester = script.Parent
tester.Humanoid.HealthChanged:Connect(function(hpleft)
local hplost = (tester.Humanoid.MaxHealth - hpleft)
tester.Humanoid.Health = tester.Humanoid.Health + (hplost * 0.5)
end)
(50% resistance)
He said the error was:
First, the script listens for humanoid.HealthChanged, then it will set the current health + half the amount of hp lost but that would fire humanoid.HealthChanged.
