'I am getting the attempt to index nil with 'WaitForChild' error in my tower defense game

I am making a tower defense game and just got attempt to index nil with 'WaitForChild' error in my health script. The tower is looking at the enemy, playing the animations, it just does not show the updated health of the zombies. The supposed code in question is local humanoid = model:WaitForChild("Humanoid") Does anybody know how to make it show updated health?



Solution 1:[1]

model is nil. Make sure you set it properly.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Luke100000