Update roblox has broken a script related to custom sounds materials

Hello users again, this time I am having difficulty correcting a scirpt of mine.
Ah some atraz messes there in August I saw a tuturial how by a User to sounds in certain materials when walking however for there in October / November came a roblox update that moved a running chamdo sound Head of character for humanoidRootPart .
The old script:
local Character = script.Parent
local Head = Character:WaitForChild(“Head”)
local RunningSound = Head:WaitForChild(“Running”)
local FootstepsSoundGroup = game:GetService(“SoundService”):WaitForChild(“WalkCustomSounds”)
local Humanoid = Character:WaitForChild(“Humanoid”)

Humanoid.Changed:Connect(function(property)
if property == “FloorMaterial” then
RunningSound.SoundId = FootstepsSoundGroup:WaitForChild(Humanoid.FloorMaterial).SoundId
RunningSound.PlaybackSpeed = FootstepsSoundGroup:WaitForChild(Humanoid.FloorMaterial).PlaybackSpeed
RunningSound.Volume = FootstepsSoundGroup:WaitForChild(Humanoid.FloorMaterial).Volume

	if FootstepsSoundGroup:FindFirstChild(Humanoid.FloorMaterial) == nil then
		RunningSound.SoundId = FootstepsSoundGroup:WaitForChild("nil Sound").SoundId
		RunningSound.PlaybackSpeed = FootstepsSoundGroup:WaitForChild("nil Sound").PlaybackSpeed
		RunningSound.Volume = FootstepsSoundGroup:WaitForChild("nil Sound").Volume
	end
end

end)

Later, I then changed the location to where this sound was (which was in humanoidrootpart) but to the error an error appears
Script changed:
wait()
local Character = script.Parent
local HumanoidRootPart = Character:FindFirstChild(“HumanoidRootPart”)
local RunningSound = HumanoidRootPart:FindFirstChild(“Running”)
local FootstepsSoundGroup = game:GetService(“SoundService”):FindFirstChild(“WalkCustomSounds”)
local Humanoid = Character:WaitForChild(“Humanoid”)

Humanoid.Changed:Connect(function(property)
if property == “FloorMaterial” then
if FootstepsSoundGroup:FindFirstChild(Humanoid.FloorMaterial) == nil then
RunningSound.SoundId = FootstepsSoundGroup:WaitForChild(“nil Sound”).SoundId
RunningSound.PlaybackSpeed = FootstepsSoundGroup:WaitForChild(“nil Sound”).PlaybackSpeed
RunningSound.Volume = FootstepsSoundGroup:WaitForChild(“nil Sound”).Volume
else
RunningSound.SoundId = FootstepsSoundGroup:WaitForChild(Humanoid.FloorMaterial).SoundId
RunningSound.PlaybackSpeed = FootstepsSoundGroup:WaitForChild(Humanoid.FloorMaterial).PlaybackSpeed
RunningSound.Volume = FootstepsSoundGroup:WaitForChild(Humanoid.FloorMaterial).Volume
end
end
end)

I’ve actually been making some changes however not resulting by the line that surrounds “RunningSound.SoundId = FootstepsSoundGroup: WaitForChild (Humanoid.FloorMaterial) .SoundId” will give a null error on the “RunningSound” part.
Any suggestions to resolve this error? I searched for RunningSound in roblox studio and found nothing.

You’ll need to change your script to change things on the client:

i know i post this in the recent script

1 Like

well then i’ll have to start from the beginning

OK I solved the problem, thanks

1 Like