for @uglyburger0 or anyone who can help. I tried to make my own script, and try other scripts, and tutorials. None of them work for R15? I don’t know why but it won’t.
Module : Footstep Module - Creator Marketplace (roblox.com)
Video : Roblox Footstep Sound Effects Module - YouTube
It only works when I follow uglyburgers tutorial when you press a button.
It works in my game. what do you want to do, implement it so that the sounds are activated n all that? I can provide a script to do that if you need.
Pretty self explanatory, I just need it so when u step makes sounds based on what material you’re on
Alright, here:
- Make sure the module is a child of ReplicatedStorage, then insert this as a localscript under StarterCharacterScripts:
local Run = game:GetService("RunService")
local Debris = game:GetService("Debris")
local Char = script.Parent
local Hum: Humanoid = Char:WaitForChild("Humanoid")
local FootSteps = require(game.ReplicatedStorage:WaitForChild("FootstepModule")) -- set this to whatever your footstep module name is
local SOUND_DELAY = 0.5
local isRunning = false
local isSprinting = false
local soundPlaying = false
local function CreateSound(id)
local sound = Instance.new("Sound")
sound.SoundId = id
sound.Volume = 0.05
sound.Parent = workspace
return sound
end
Hum:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if Hum.MoveDirection.Magnitude > 0 then
isRunning = true
else
isRunning = false
end
end)
Hum:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if Hum.WalkSpeed > 11 then
isSprinting = true
SOUND_DELAY = 0.3
else
isSprinting = false
SOUND_DELAY = 0.5
end
end)
Run.RenderStepped:Connect(function()
if isRunning and not soundPlaying then
if Hum.FloorMaterial == Enum.Material.Air then return end
local materialTbl = FootSteps:GetTableFromMaterial(Hum.FloorMaterial)
local soundId = FootSteps:GetRandomSound(materialTbl)
local sound = CreateSound(soundId)
sound:Play()
soundPlaying = true
Debris:AddItem(sound, sound.TimeLength)
task.wait(SOUND_DELAY)
soundPlaying = false
end
end)
still does not work. these are one of the scripts I tried. There is no error which is weird because the sound wont create either.
hmm, weird. can I see your workspace and whatever scripts you have for this?
Nevermind, I made a workaround for your script. Instead of making sounds I just changed 1 sound id each time I walked.
local Run = game:GetService("RunService")
local Debris = game:GetService("Debris")
local Char = script.Parent
local Hum: Humanoid = Char:WaitForChild("Humanoid")
local FootSteps = require(game.ReplicatedStorage:WaitForChild("FootstepModule")) -- set this to whatever your footstep module name is
local SOUND_DELAY = 0.5
local isRunning = false
local isSprinting = false
local soundPlaying = false
local sound = Instance.new("Sound")
sound.Volume = 1
sound.Parent = Char.HumanoidRootPart
local function CreateSound(id)
sound.SoundId = id
end
Hum:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if Hum.MoveDirection.Magnitude > 0 then
isRunning = true
else
isRunning = false
end
end)
Hum:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if Hum.WalkSpeed > 11 then
isSprinting = true
SOUND_DELAY = 0.3
else
isSprinting = false
SOUND_DELAY = 0.5
end
end)
Run.RenderStepped:Connect(function()
if isRunning and not soundPlaying then
if Hum.FloorMaterial == Enum.Material.Air then return end
local materialTbl = FootSteps:GetTableFromMaterial(Hum.FloorMaterial)
local soundId = FootSteps:GetRandomSound(materialTbl)
CreateSound(soundId)
sound:Play()
soundPlaying = true
print("creating sound")
task.wait(SOUND_DELAY)
soundPlaying = false
end
end)
2 Likes
alright, great! glad to help.
(char limit)
1 Like