I'm trying to make an enemy NPC script, everything else in the script works except this part of the code:
for _, Child in pairs(script.Parent:GetChildren()) do if Child:FindFirstChild("DangerZone") then Child.Touched:connect(Hit) print("Player has been hit") end end
I'm still learning how GetChildren works, so sorry if I'm using it wrong or if I need to use something else.