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

how do i make a sound play in a player's torso when they touch a part?

I am trying to make a hitbox for a sword I'm making, the hitbox is working fine, but I would like a hit sound to play in the player's torso when they touch the hitbox, how can I do this?

local debounce = false
script.Parent.Touched:connect(function(hit)
	if debounce == false then
		debounce = true
	if hit.Parent:FindFirstChild("Humanoid")then
		hit.Parent.Humanoid:TakeDamage(5)
		end
		wait(3)
		debounce = false
	end
end)

1 answer

add the sound to the script make the sound's parent the script

then, after you make the other player do damage, do

PutSoundHere:Play()

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