Greetings, I am attempting to make a script when activated makes a target take 25% more damage, however it displays Maximum event re-entrancy depth exceeded for Humanoid.HealthChanged in the console when i attempt to do so. I believe I’m missing something to do with optimization, but I’m not sure how to fix it.
Script segment:
if ExtraDamage == true then
local TargetPrevHealth = Target.Humanoid.Health
Target.Humanoid.HealthChanged:Connect(function()
local TargetCurrHealth = Target.Humanoid.Health
Target.Humanoid.Health = TargetCurrHealth - (Target.Humanoid.Health / 25)
local TargetPrevHealth = Target.Humanoid.Health