You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear! To change the footstep sound after a prompt activation
What is the issue? Include screenshots / videos if possible! It says “Running is not a valid member of Part “Workspace.the player name.HumanoidRootPart””
What solutions have you tried so far? Did you look for solutions on the Developer Hub? Yes, however i could only find how to change the footsteps at the start of the game (i.e. the RbxCharacterSounds script)
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
script.Parent.Triggered:Connect(function(player)
for _, descendant in pairs(game.StarterPlayer:GetDescendants()) do
if descendant.Name == "StarterCharacter" then
descendant:Destroy()
end
end
c = script.Parent.Parent:Clone()
c.Parent = game.StarterPlayer
c.ProximityPrompt:Destroy()
workspace[player.Name].Humanoid.Health = 0
task.wait(1)
workspace[player.Name].HumanoidRootPart.Running.SoundId = "174960816"
end)
This is what my script currently looks like. I have tried WaitForChild() but it was the same problem, minus the output error.
when your in playtest check the player’s humanoidrootpart for running or in your script add a debug. for example ex. local check = player.HumanoidRootPart:FindFirstChild(“Running”) if check then
Here, i made a mock up, Make a remote event in replicated storage named “Walking” Proximity Prompt Script
script.Parent.Triggered:Connect(function(player)
for _, descendant in pairs(game.StarterPlayer:GetDescendants()) do
if descendant.Name == "StarterCharacter" then
descendant:Destroy()
end
end
c = script.Parent.Parent:Clone()
c.Parent = game.StarterPlayer
c.ProximityPrompt:Destroy()
workspace[player.Name].Humanoid.Health = 0
task.wait(1)
local character = player.Character
local Remote = game.ReplicatedStorage:WaitForChild("Walking")
if player then
local humanoid = character:FindFirstChild("Humanoid")
local rootPart = character:FindFirstChild("HumanoidRootPart")
if humanoid and rootPart then
Remote:FireClient(player)
end
end
end)
Then make a local script in StarterPlayerScripts Local Script
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local remote = game.ReplicatedStorage:WaitForChild("Walking")
remote.OnClientEvent:Connect(function()
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
for _, sound in ipairs(humanoidRootPart:GetDescendants()) do
if sound:IsA("Sound") and sound.Name == "Running" then
sound.SoundId = "rbxassetid://174960816" -- ID
end
end
end
end)