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

How can I make the sound not stop when I hit npc?

Asked by
brok4d 77
5 years ago

Hello, good morning, I have the problem that when I hit a npc with the car it stops the sound of the engine and I know that it is because they have a humanoid. How can I do it to fix it?

Car.PrimaryPart.TouchEnded:Connect(function(touch)
    Ground.Touched:Connect(function(touch)
        if not debounce then
            debounce = true

            if touch.Parent:FindFirstChild('Humanoid') then
                soundEngine:Stop()
                fire.Enabled = false
            end
            wait(2)
            debounce = false
        end

    end)
end)

1 answer

Log in to vote
0
Answered by 5 years ago

You can check the name. Put this in the humanoid check.

if touch.Name ~= "NPC" then
--Your code
end
0
Thank you very much, but I had to put touch.Parent.Name, thank you very much. brok4d 77 — 5y
0
Ah, simple mistakes, I make it everytime. Glad I could help :) SirDerpyHerp 262 — 5y
Ad

Answer this question