Cloned sounds play globally, even when parented to the character (CAN BE HEARD FROM ANYWHERE)

My tools originally cloned a random sound from replicated storage (or server storage, tried both and neither worked), parented it to the tool, and played it, using something like this:

	local soundsFolder = RS.Sounds.Sword.Swing
	local sounds = soundsFolder:GetChildren()
	local randomSwing = sounds[math.random(1, #sounds)]:Clone()
	randomSwing.Parent = tool
	randomSwing:Play()
	debris:AddItem(randomSwing, 1)

And parented the sound directly into the tool. Slight problem: my tool was handle-less, meaning the sound played globally. To try to fix this, I instead parent the sound to the player’s character. The sounds STILL play globally. Why?? Searched for over an hour and couldn’t find a reason as to why my sounds were acting this way. So I tried making a handle for the tool and cloning the sound into the new handle and it still played globally. The only thing that fixed it was completely moving the sounds out of Replicated Storage or Server Storage, and into the tool, then cloning it into the handle. Same thing happens for a double jump script of mine. Trying to clone a sound into the player’s character just makes it play globally instead of at the player’s character. This is extremely inefficient and terrible. Please help.

YES I HAVE TRIED PARENTING THE SOUND TO THE PLAYER’S ROOTPART, NO IT WAS NOT SUCCESSFUL EITHER

Not exactly sure what the cause of the problem is, but I would advise against cloning sound objects. Keep the sound object under wherever you want the sound to play.

1 Like

is that a server script

Yes. I really only use server scripts for my tools to avoid any sort of exploitation.

Sounds like it should be as it is a sword swing sound. Anyways, to keep a sound to a player only toss it in their PlayerGui.

By globally, I mean it can be heard from anywhere at full volume.

Why not parent the sound to a local object, like a GuiObject or a local script?

… because it’s a sound that is to be played in 3D space. The issue is that the sound can be heard from anywhere, as if I were playing to everyone locally.

Try SoundService without 3D properties.

I don’t think sounds localize if parented to models (tools included). They only do that if their direct parent is a part or attachment.

This is the part that’s a bit strange to me. What are the roll-off distances of the sound? Are you accidentally playing the template sound instead? Are you relying on any part of the new audio wire system?

I think he is looking to avoid any type of drop off to the sound. 3d sound is default in the character and the tool. This one is, place the sound in SoundService.

Considering this is a server script, you would want to create a remote event that a local script can pick up on. Then in that local script move the sound object into the PlayerGui so it only plays for the player.

1 Like

see if you can mange the swing in a server script and the sound in a client script

i will assume that when a player click their screen (or a text/image button scaled to 1)
you do what you are scared to do in a server script
then fire a remote event to the client script and play the sound

btw i did not fully understand what you are trying to make (: