Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

NPCactivity is not a valid member of Model?

Asked by 1 year ago

I have an error popping up NPCactivity is not a valid member of Model is it possible to solve it I am waiting for your answer This is a shield for my character

here is the script wait() local sp = script.Parent local shield = sp.Shield local auxhealth = sp.AUXhealth local Humanoid = sp:FindFirstChild("Humanoid") local DamageAbsordPerShield = 350 local CurrentShieldHealth = DamageAbsordPerShield

local tempinvincible = false

if Humanoid and Humanoid.Health ~= 0 then

Humanoid.Health = Humanoid.MaxHealth
local CurrentHealth = Humanoid.Health

Connection = Humanoid.HealthChanged:connect(function(Health)
    local Change = math.abs(CurrentHealth - Health)
    if CurrentHealth > Health then

        if shield.Value >= 1 then

            Humanoid.Health = Humanoid.MaxHealth

            shield.Value = shield.Value - Change

        elseif auxhealth.Value >= 1 then

            Humanoid.Health = Humanoid.MaxHealth

            auxhealth.Value = auxhealth.Value - Change

        elseif auxhealth.Value <= 0 and tempinvincible == false and script.Parent.NPCactivity.Fury.Value == false then
            tempinvincible = true

            repeat
                wait(1)
            until script.Parent.NPCactivity.Fury.Value == true

            tempinvincible = false

        elseif tempinvincible == true then

            Humanoid.Health = Humanoid.MaxHealth

            script.Parent.HitPoints.Value = script.Parent.HitPoints.Value - Change

        else

            --Do nothing...

        end



    end
    CurrentHealth = Humanoid.Health
end)

else

end

Answer this question