Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Custom footstep sound script not working?

Asked by 4 years ago

So, I wanted to make a footstep sound script for my game, but somehow, it doesn't work! It's parented to StarterCharacterScripts. (which automatically parents the scripts inside it to any joining player)

Here is my code sample.

local WalkSoundOrigin = script.Parent:FindFirstChild("HumanoidRootPart")
local Humanoid = script.Parent:FindFirstChild("Humanoid")
local ConcreteSound = "rbxassetid://6144455074" -- Will be played when the player is stepping on the material "Concrete".
local SandSound = "rbxassetit://6154305275" -- Will be played when the player is stepping on the material "Sand"

WalkSoundOrigin.Running.PlaybackSpeed = 1

if Humanoid.FloorMaterial == Enum.Material.Concrete then
    WalkSoundOrigin.Running.SoundId = ConcreteSound
end

Anything I'm missing here? I checked the Humanoid properties, and it was on the concrete, but still not changing the "Running" SoundId.

0
on the script i see a incomplete variable at line 01 ShinyPhenomenal -3 — 4y

Answer this question