How can you make an if statement do nothing?

local Part = script.Parent

function Fall(part)
local humanoid = part.Parent:FindFirstChild(“Humanoid”)
if humanoid then
print(“No”)
else
print(“Yes”)
end
end

Part.Touched:Connect(Fall)

What this code is doing is trying to know if either another part touched the brick, or a player. The thing is, I only want it to fire when another part touches it. I was wondering if there is any way to make the if statement do nothing instead of printing “no”

You can just remove the print :

if humanoid then
else
    print("Yes")
end

Alternatively :

if not humanoid then
    print("Yes")
end
1 Like

and for the final alternatives.

if humanoid then
else
end

if not humanoid then
else
end

if humanoid then
elseif not humanoid then
end

if not humanoid then
elseif humanoid then
end
1 Like