Ad
Log in to vote
0

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

Asked by 16 days ago

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

Log in to vote
0
Answered by
F100F9 0
16 days ago

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()

Ad

Answer this question