local function SHC(Hum,Result,Shield)
Shield -= Result
if Shield > 0 then
print("SHIELD =",Shield)
elseif Shield < 0 then
Hum.Health += Shield
print("SHIELD =",Shield)
print("HEALTH =",Hum.Health)
end
end
--Stats--
--Health Calcuations
module.DAC = function(Hum,Damage,Values)
local Shield = Values.Shield.Value
local Defense = Values.Defense.Value
local Modifier = Values.DMGModifier.Value
local Result = Round((Damage - Damage / 100 * Defense) * Modifier)
if Shield == 0 then
Hum.Health -= Result
print("HP DIFF =",Result)
else
SHC(Hum,Result,Shield)
end
end
Module script ^
Negative.Touched:Connect(function(hit)
if CD == false then
local Values = hit.Parent:WaitForChild("Handler").Values
local Char = hit.Parent
module.DAC(Char.Humanoid,25,Values)
Cooldown()
end
end)
you are only passing in the shield’s value, not a reference to it, you’d have to pass Values.Shield, and subtract Result from Shield.Value inside ur SHC function
i don’t believe thats a properly reply, also he had to pass in the instance which you didn’t tell him, he would have kept passing in the number and trying to access its Value property