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