How would I get this audio to change to the preferred audio?

I was wondering why the script was not causing the audio inside the player to change their moving sounds. You can test this on your own by copying the following script in ServerScriptService

local Players = game:GetService("Players")

--[[
The SoundIds that can be assigned. When changing, use example:
local example = "rbxassetid://5721510093"
When adding your own sounds, add "id" to the end of "rbxasset"

--]]

Players.PlayerAdded:Connect(function(player)
	
	--These are the variables you change
	local Running = 5721510093
	local Died = 0
	local Climbing = 0
	local FreeFalling = 0
	local GettingUp = 0
	local Jumping = 0
	local Landing = 0
	local Splash = 0
	local Swimming = 0
	
	local RunningSoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
	local DiedSoundId = "rbxasset://sounds/uuhhh.mp3"
	local ClimbingSoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
	local FreeFallingSoundId = "rbxasset://sounds/action_falling.mp3"
	local GettingUpSoundId = "rbxasset://sounds/action_get_up.mp3"
	local JumpingSoundId = "rbxasset://sounds/action_jump.mp3"
	local LandingSoundId = "rbxasset://sounds/action_jump_land.mp3"
	local SplashSoundId = "rbxasset://sounds/impact_water.mp3"
	local SwimmingSoundId = "rbxasset://sounds/action_swim.mp3"
	
	
	
	local setVariables = {
		Running,
		Died,
		Climbing,
		FreeFalling,
		GettingUp,
		Jumping,
		Landing,
		Splash,
		Swimming
	}
	
	local usedSounds = {
		RunningSoundId,
		DiedSoundId,
		ClimbingSoundId,
		FreeFallingSoundId,
		GettingUpSoundId,
		JumpingSoundId,
		LandingSoundId,
		SplashSoundId,
		SwimmingSoundId
	}
	
	print("Running sound is " .. setVariables[1])
	print(table.getn(setVariables))
	for x=1, table.getn(setVariables), 1 do 
		if setVariables[x] ~= 0 then
			usedSounds[x]=setVariables[x]
			print("Sound Number " .. x .. " Was Changed by Script to Sound Id " .. usedSounds[x])
		else
			print("Sound Number " .. x .. " Will Stay as Default Sound")
			print(setVariables[x])
		end
	end
	
	
	
	
	
	
	
	wait(5)
	local sounds = player:WaitForChild("HumanoidRootPart")
	sounds.Running.SoundId="rbxassetid://" .. usedSounds[1]
	print()
	sounds.Died.SoundId="rbxassetid://" .. usedSounds[2]
	sounds.Climbing.SoundId="rbxassetid://" .. usedSounds[3]
	sounds.FreeFalling.SoundId="rbxassetid://" .. usedSounds[4]
	sounds.GettingUp.SoundId="rbxassetid://" .. usedSounds[5]
	sounds.Jumping.SoundId="rbxassetid://" .. usedSounds[6]
	sounds.Landing.SoundId="rbxassetid://" .. usedSounds[7]
	sounds.Splash.SoundId="rbxassetid://" .. usedSounds[8]
	sounds.Swimming.SoundId="rbxassetid://" .. usedSounds[9]
end)

when you do

local sounds = player:WaitForChild("HumanoidRootPart")

sounds will infinite yield because it will search for “HumanoidRootPart” inside the player and not the character. Instead, do

player:WaitForChild("Character"):WaitForChild("HumanoidRootPart")

@sniper74will I don’t fully understand what you posted above. There’s no "Character inside of my player in workspace when I join the game. I don’t know what you’re seeing.

Just to check and make sure I wasn’t the one who was wrong, I changed the previous variable from

local sounds = player:WaitForChild("HumanoidRootPart")

and changed it to this:

local sounds = player:WaitForChild("Character"):WaitForChild("HumanoidRootPart")

and the script is still not inserting the preferred sound id into the right area.
Here’s my current game:
testworld1.rbxl (188.4 KB)

This should work, but this was downloaded from a linux version of Studio that is not quite the same. If this does not work, please tell me.

Your player is not in workspace, it’s on the “Players” section and there is not character in there the thing you see in workspace is your character so do what he said
So put it in
game.Workspace.PLAYERNAME.HuminoidRootPart

I forget exactly how you do that but I think it’s through a local script or normal script in StarterCharacterScripts

Edit: I think your using Grapefruit to run studio the only difference is that some addons will give you a seizure and the captcha crashes it. I haven’t used it in a while so it could be different