Purpose Of Script: Make the values true when Health is 50 and bellow , then make it false if above 50
Problem: It does not change the values, there are no errors in the output and the only things that are printed are-Checking-Good Hp-false-false, I have used a sword in my place and when it's health is clearly below 50 or even 0 It still says Good Hp, I do not know what's the problem, I have tried things like changing the variables to waitforchild,findfirstchild and regular format(script.parent.[NAME])
Script Location: Its located in the NPC there is a humanoid, and is named such, it is a regular script
Script
local humanoid = script.Parent:FindFirstChild('Humanoid')
local Health = humanoid.Health
local MaxHealth = humanoid.MaxHealth
function Check2()
local Boss = script.Parent
local FieldDefense = script.Parent:WaitForChild('FieldDefense')
local Healing = script.Parent:WaitForChild('Healing')
if Health > 50 then
print('Good Hp')
FieldDefense.Value = false
Healing.Value = false
print(Healing.Value)
print(FieldDefense.Value)
end
end
function Check()
local Boss = script.Parent
local FieldDefense = script.Parent:WaitForChild('FieldDefense')
local Healing = script.Parent:WaitForChild('Healing')
if Health <= 50 then
print('Low Hp')
FieldDefense.Value = true
Healing.Value = true
print(Healing.Value)
print(FieldDefense.Value)
end
end
while wait(.1) do
print("Checking")
Check()
Check2()
end

2 comments
Your question structure and information pleases me. Have a cookie.
lol, I'll take some help instead, and also a vote up since I cannot chat i the SH Chat ;-;