Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

[?!?!?] How come my script won't print hi even when i have "Break" inside Humanoid?

Asked by 4 years ago

trying to make a script that looks for "Break" inside Humanoid before printing "Hi", but it prints out nothing to the output. Any solutions?

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid"):FindFirstChild("Break") then
        print("hi")
    end
end)
0
Is break actually inside of the humanoid? And did you even touch the part? SteamG00B 1633 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

do this

script.Parent.Touched:Connect(function(hit)
    local humanoid = hit.Parent:FindFirstChild("Humanoid")
    local Break = humanoid:FindFirstChild("Break")
        if humanoid and Break then
            print("hi")
        end
end)
Ad

Answer this question