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

How do i make the NPC go faster on low health?

Asked by 2 years ago
if script.Parent.Minor.Health <= 900 then
    script.Parent.Minor.WalkSpeed = 39
end

i used this script someone on this website gave me and IT DOESN'T WORK i need help (the humanoid in the npc is named Minor btw)

0
What's the full code, what type of script is it, and what is it under? sheepposu 561 — 2y
0
thats the full code dylancrazy88 20 — 2y

2 answers

Log in to vote
2
Answered by
Cirillix 110
2 years ago

(Put script inside npc) Assuming your npc has an humanoid inside, you could just do

local hum = script.Parent:WaitForChild("Humanoid")

hum.HealthChanged:Connect(function()
        if hum.Health <= 900 then
              hum.WalkSpeed = 39
       end
end)
0
You are correct Xapelize 2658 — 2y
Ad
Log in to vote
0
Answered by 2 years ago
Edited 2 years ago



~~~~~~~~~~~~~~~~~

``~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

GetChildren ("Mob") if Health >50 add speed = +5 if Health >30 add speed = +10 if Health >10 add speed = +20 end) end)~~~~~~~~~~~~~~~~~

0
uhh you should put your code in the code block (the ~~) so it's easier to read i'm having a stroke dylancrazy88 20 — 2y
0
anyway your script doesn't work and it's hard to read by the way you wrote it dylancrazy88 20 — 2y

Answer this question