this code word perfectly fine but it keeps giving me an error stating: ServerScriptService.Lava:9: attempt to index nil with 'Health'
local mg = game.Workspace:WaitForChild("Maingame")
local lavas = mg:WaitForChild("Lava")
for _, lava in pairs(lavas:GetChildren()) do
lava.Touched:Connect(function(otherpart)
local touched = otherpart.Parent:FindFirstChild("Touched")
local humanoid = otherpart.Parent:FindFirstChild("Humanoid")
humanoid.Health = 0
end)
end
