How are footstep sounds heard by other clients?

With the change of sounds from server to client, I can’t figure out how to make sure that other players in my game hear the same footstep sounds as the current client does, I’m not sure how this is handled in the new RbxCharacterSounds script since it doesn’t really look like it handles it.

1 Like

I believe there’s a server script (or maybe a local script) that tracks the state of each player’s humanoid and then plays the corresponding sound for that state within the player’s head (e.g HumanoidStateType.Running would play footstep sounds). You can use StateChanged on humanoids to do this yourself and then you can assign different sounds to different Humanoid states for example.

Alternatively, you should also just be able to tweak the existing scripts or sound ids if you’d like. Tweaking the existing sound ids would be easiest as you simply need to access the Sound instance, and then change the id. That way you don’t rely on forking Roblox scripts, and having to manually implement changes Roblox make.

1 Like

There should be a property in SoundService called RespectFilteringEnabled. Turning that to false should solve your problem.

I can’t currently remember the exact name of the property so bear with me.

1 Like

That would solve my problem,
however my game has multiple client sided sounds that aren’t supposed to be heard by others. I just would like to know how roblox defaults to making player sounds (jumping, running, etc) globally heard to other players when the sounds are completely local to each player.

I would highly recommend not doing this for many reasons. The biggest one being that this allows exploiters to effortlessly crash your servers by spamming sounds, and two this is just bad practice as it allows exploiters to control sounds in your game which is undesirable and can be abused.

3 Likes

If you play the sounds from a localscript that set the sounds’ parents to their character or something similar, that’ll replicate to other clients.

If the sounds are played with SoundService:PlaySound() or are in something like PlayerGui, those won’t replicate.

1 Like

I haven’t seen anything like this, and a quick search only results in something from 2015 involving this.

They can only change things locally for them. The only thing they can “control” is they can play sounds other players can hear.

2 Likes

This is because RespectFilteringEnabled has been enabled by default for a while now. Sound crashing is extremely easy to perform, and while Roblox has been optimizing sound playing, it’s still painless to perform on any game with RespectFilteringEnabled off, especially large scale games. You can easily test this yourself by creating a LocalScript which plays all sounds in game a thousand or so times per frame. It’ll lag your client, but it’ll easily crash the server especially when many players are in game (For example, throughout 2016-2017 or so this was frequently used in Frappe to mass disconnect players).

Secondly, yes they can only control playing sounds, however this can be used to confuse players, annoy them, and depending on the sounds within your game, create low quality audio. I’ve seen examples of this happening in numerous games and you should not go around allowing exploiters control of anything. This is just bad practice all around, it doesn’t matter if the thing is necessarily harmless because people find a way to abuse it.

1 Like

The default localscript that roblox creates does just that, it parents a sound to the character. However when I test it, with updated sounds other players don’t hear what the localplayer hears. This is very confusing for a few reasons, but mainly because usually you can hear other player’s footsteps by default, while respectfilteringenabled is on in soundservice.

I’m not quite sure what you mean. Are you changing properties of the sound on the client or something? You should be doing that on the server (e.g. if you’re trying to change the sound id that plays). What does the local player hear and what are other player’s intended to hear?

1 Like

Playersounds are handled completely on the client by default for roblox. There is no serverscript that handles sound. If you try to find the default footstep sound on the server it’ll throw an error as it doesn’t exist for the server.

The issue was I was referencing the localplayer’s character rather than relying on the script’s original method. in the future, the solution would be to simply use player.CharacterAdded to connect a sound to each player, and reference each player’s humanoid’s floormaterial rather than simply doing the localplayer. Thank you for helping :slightly_smiling_face:

3 Likes

To respond specifically to the OP: the client completely handles all sounds, both their own and those of other clients by referencing their Humanoid state which is replicated. There’s zero server-side involvement. When you’re hearing other clients’ footsteps sounds, you’re actually just hearing your own client play a sound using another character as an emitter.

9 Likes