RemoteEvents problems

so in my game when a players gets hit then it will fireclient, on the onclientevent the punchsound will get cloned and play
and thats the problem( it clones too many times)
any suggestions that i can use to fix it?

Add a debounce on the event after the first hit. With the Touch event, it can fire multiple times for the same part or for multiple parts simulaneously.

its in onclientevent not touched event and debounces doesnt work

Something like the following would probably work to restrict it

-- the local script pseudo code
local sound = <yourSound>
local debounce

local function playSound()
    debounce = true
    sound:Play()
   sound:.Ended:Wait()
    debounce = false
end

yourRemote.onclientevent:Connet(playSound()

Dont clone the sound instance per hit, just have 1 sound instance, and when OnClientEvent fires just grab that Sound instance and play it, instead of clone one per hit

but will that still play for other ppl tho

?
I dont understand what you mean, you didnt explained whats your goal about replication in your topic. The sound should play for only the client or should be for all clients? or should be on server?

if i dont clone it in onclientevent(all clients)
could other people in the game still hear it ?

If you handle an instance on ClientSide, as the sound and play it on clientSide, then only that Player will hear it. Idk what you desire, all players should hear it? or only the client?

i want all the players to hear it using onclientevent and i just dont know if i dont clone it will it still work

You have a couple of approaches to get that result. Depends what you like more.
You could simply have a Sound instance in Player’s Characters made by Server since the start, and let a Server script Play that sound, everyone in server will heart it.

You could handle it on client side too by Firing All Clients, sending the Sound instance in the player that got hit, and Play it on each client script of all players, in order to get replication so everyone in server can hear it.

Its not about cloning or not, its about from where you are playing it (client or server).
About the cloning depends on you, I would use the cloning if I want to change the sound source for a specific part inside the character, like the sound could come from head or from a leg depending on where is the hit, if I want to make a more complex sound system that could handle many different hit sounds coming from different parts at once.

If you are aiming for a simplier system, with only one instance you could handle the hit sound, specially if its not a long audio