wait(1)
attack = 5
children = game.Workspace.Dummy:GetChildren()
function hitObject(hit)
if hit.Parent.Humanoid ~= nil then
hit.Parent.Humanoid.Heath = hit.Parent.Humanoid.Health - attack
end
end
for i = 1,#children do
if children[i].ClassName == "Part" then
children[i].Touched:connect(hitObject())
end
end
follow =
false
human = game.Workspace.Dummy.FindFirstChild("Humanoid")
while true do
if game.Players.Player1.Character:FindFirstChild("Torso") ~= nil then
if game.Players.Player1.Character.Torso.Position.X - game.Workspace.Titan.Torso.Position.X <= 10 then
follow = true
end
end
if follow then
if game.Players.Player1.Character:FindFirstChild("Torso") ~= nil then
human.WalkToPoint = game.Players.Player1.Character.Torso.Position
end
end
wait(.5)
end
COMMUNITY QUESTION
This is a simple AI script but .Humanoid says not valid member of script. Does anyone know why?
1 answer
You spelled Health as Heath. Line 7.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
what is AI script?
Artificial Intelligence it is trying to make the npc follow a human when it gets into 10 units of range like a zombie
You forgot to spell "Health" on line 7.