Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

if touch.Name ~= "NPC" then
--Your code
end

2 comments

0

Thank you very much, but I had to put touch.Parent.Name, thank you very much.

0

Ah, simple mistakes, I make it everytime. Glad I could help :)

This discussion is preserved as it was. New answers, comments, and votes are closed.