Play global sounds

Hi,
do you know how can i play GLOBALLY, NOT LOCALLY sounds from player while he is moving? I have a script but it does work only locally (even if i clone “Running” sound from root part and paste it into root part with other id, it is not global as original Running sound)

local Player = game.Players.LocalPlayer
local Character = Player.Character
Player.Character.HumanoidRootPart.Running.Volume = 0.1

local DefaultSound = Character.HumanoidRootPart:WaitForChild("Running").SoundId
Character.HumanoidRootPart:WaitForChild("Running").Archivable = true


local AddictionalSound = Character.HumanoidRootPart:WaitForChild("Running"):Clone()
AddictionalSound.Name = "AddictionalSound"
AddictionalSound.SoundId = DefaultSound
AddictionalSound.Volume = 1
AddictionalSound.PlaybackSpeed = 1
AddictionalSound.Parent = Character.HumanoidRootPart
local MaterialTable = {
	[Enum.Material.Grass] = "rbxassetid://9113702134",
	[Enum.Material.Wood] = "rbxassetid://9058073414",
	[Enum.Material.Fabric] = "rbxassetid://9120475712",
	
}


Character.Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
	local FloorMaterial = Character.Humanoid.FloorMaterial
	if MaterialTable[FloorMaterial] then
		AddictionalSound.SoundId = MaterialTable[FloorMaterial]
	else
		AddictionalSound.SoundId = ""
	end
end)



Character.Humanoid.Running:Connect(function(speed)
	if speed > 0 then
		AddictionalSound:Resume()
	else
		AddictionalSound:Pause()
	end
end)



local function hasProperty(object, prop)
	local t = object[prop] --this is just done to check if the property existed, if it did nothing would happen, if it didn't an error will pop, the object[prop] is a different way of writing object.prop, (object.Transparency or object["Transparency"])
end


for i,v in pairs(Player.Character:GetDescendants()) do
	local success = pcall(function() hasProperty(v, "CastShadow") end) --this is the part checking if the transparency existed, make sure you write the property's name correctly.CastShadow = false
	if success then
		v.CastShadow = false
	end
end
1 Like

Have you tried using a server script instead? [You could put that in StarterCharacterScripts and get the player simply through the Character which is the script’s parent and then adjust your script].

It doesn’t work :confused:
Script was in character scripts all the time but i forgot to use script.Parent

Global sounds have to be in the workspace I think and are meant to be heard wherever you are in the game.
Local sounds are in Parts or other instances so they are limited to the range from the Part.

Why are you trying to make footsteps Global? Do you want everyone in the game to hear when your avatar is walking? If you just want players around you to hear your footsteps you should be able to place the sound in your HumanoidRootPart and have it play from there.