I am trying to make a simple zombie round based survival game, I need to make the lava only kill the player and not any other humanoid. Any suggestions?
function onTouch (part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
humanoid.Health = 0
local ms = Instance.new
ms.Text = "Do not step outide the base!"
ms.Parent = workspace
wait(5)
ms:remove()
end
end
script.Parent.Touched:connect(onTouch)
The message plays even though a zombie touches the brick. The goal of the game is to stay in your bunker while shooting zombies all the time.

4 comments
What you could do is make a "RemoteEvent" inside the part, and fire it when a player touches it.
no, that's a bit too complicated
Get the player’s character through part.Parent and use :GetPlayerOnCharacter(char) on the Players service to check if the character is a player.
there is a much easier way, I'll explain