Hi, I’m attempting to change the running sound’s SoundId in a Footsteps script, but whilst this is successful for the client who changed it, other clients still do not hear the changed sound, and rather the default running sound.
The sound is being set in a SetSound function:
function Footsteps.SetFloorSound(Character)
local Humanoid: Humanoid = Character.Humanoid
local HumanoidRootPart: BasePart = Character.HumanoidRootPart
if not Humanoid then
return
end
if not HumanoidRootPart or (HumanoidRootPart and not HumanoidRootPart:FindFirstChild("Running")) then
return
end
if Humanoid.FloorMaterial == Enum.Material.Air then
return
end
local Sound: Sound = FootstepsFolder[Humanoid.FloorMaterial.Name]
if Sound then
HumanoidRootPart.Running.SoundId = Sound.SoundId
HumanoidRootPart.Running.PlaybackSpeed = Humanoid.WalkSpeed / 17
end
end
This is being executed on when the FloorMaterial changes, and once at the start of every session. This is done on the client.
Any changes made on the client does not replicate to the server. So either change that to server sided script or make a RemoteEvent that tells the server to change the sound the sound. There’s probably a few more other solutions but I’d stick with the 1st one since well, it likely the best option since using the 2nd option allows for exploiters to mess with it I guess.
Well you could check the AssemblyLinearVelocity.Magnitude of the humanoidrootpart and check if it’s higher than 1 and there’s also a function to check if the humanoid is running: Humanoid.Running:Connect() not sure why you aren’t using that but I won’t ask. You also explicitly state
And now you’re saying it is replicated someway?
I’ll just say this again making changes on the client will not affect the server.
The Roblox’s “Running” sound does not exist on the server. By changing it via a LocalScript (like Roblox’s RbxCharacterSounds) the intended functionality is it will change it for all other clients- I cannot use a RemoteEvent because the server cannot interact with the Running sound for it doesn’t exist on the Server.
If you’re only changing this for the LocalPlayer it won’t replicate. You have to change it for all other players and new players that join on the client as well.
Please review this post regarding the functionality of Roblox’s footsteps & character sound system.
Character sounds are managed by a LocalScript- I have programmed this before and they change appropriately to other clients when changed by a LocalScript. My issue here is this is not happening; please stop advising I use RemoteEvents.
I appreciate you trying to help but I’m looking for someone who has did this kind of thing before. Using your recommended solution is not the correct solution to this problem.
In theory I am sure this works; but it is a workaround to the bigger problem I have.