Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

2 comments

0

What's the full code, what type of script is it, and what is it under?

0

thats the full code

2 answers

(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)

1 comment

0

You are correct





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


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

2 comments

0

uhh you should put your code in the code block (the ~~) so it's easier to read i'm having a stroke

0

anyway your script doesn't work and it's hard to read by the way you wrote it

This discussion is preserved as it was. New answers, comments, and votes are closed.