Sound not playing

Hello, developers! I am making a game but the sound is not playing. I’ve tried to upload to my profile and my group, even giving it permissions. However, it still won’t play. Everything else works in the modulescript.

Modulescript:

local Map = {}

Map.MapModel = script.Parent

function Map:Fog(Boolean)
	if Boolean then
		for _,v in pairs(game:GetService("Workspace"):FindFirstChild("PlayersInGame"):GetChildren()) do
			game:GetService("ReplicatedStorage"):FindFirstChild("Remotes"):FindFirstChild("FogEvent"):FireClient(game:GetService("Players"):GetPlayerFromCharacter(v), true)
		end
	else
		for _,v in pairs(game:GetService("Workspace"):FindFirstChild("PlayersInGame"):GetChildren()) do
			game:GetService("ReplicatedStorage"):FindFirstChild("Remotes"):FindFirstChild("FogEvent"):FireClient(game:GetService("Players"):GetPlayerFromCharacter(v), false)
		end
	end
end

function Map:End(ElevatorMap, Killers, ElevatorTeleportPart, ElevatorEndInt)
	for i,v in pairs(game:GetService("Players"):GetPlayers()) do
		v.Character:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(ElevatorTeleportPart.Position)
	end
	
	for i,v in pairs(Killers:GetChildren()) do
		if v:IsA("Model") then
			local HumanoidRootPart = v:FindFirstChild("Torso") or v:FindFirstChild("HumanoidRootPart")
			
			HumanoidRootPart.CFrame = CFrame.new(Map.MapModel:FindFirstChild("KillersTeleportPart").Position)
		end
	end
	
	ElevatorEndInt.Value += 1
	
	wait(5)
	
	Map:Fog(false)
	
	ElevatorMap:Destroy() Killers:Destroy()
end

function Map:Run(ElevatorTeleportPart, ElevatorEndInt)
	local ElevatorMap = Map.MapModel:FindFirstChild("Map"):Clone()
	ElevatorMap.Parent = game:GetService("Workspace")
	
	local MusicPart = Map.MapModel:FindFirstChild("MusicPart")
	local Music = MusicPart:FindFirstChild("Music")
	
	wait(10)
	
	Music.SoundId = "rbxassetid://"..10625248955 -- This sound isn't playing
	Music.Volume = 0.75
	Music:Play()
	
	Map:Fog(true)
	
	wait(5)
	
	local Killers = Map.MapModel:FindFirstChild("Killers"):Clone()
	Killers.Parent = game:GetService("Workspace")
	
	wait(10)
	
	Map:End(ElevatorMap, Killers, ElevatorTeleportPart, ElevatorEndInt)
end

return Map

Sound Properties:

Thanks!

I don’t see any errors directly from the script; not that there isn’t one but I didn’t catch any. However the output would provide more information as to why this error is happening. Make sure you are requiring the module script and running the functions properly with the proper arguments. Also make sure that you provided the sound with the game’s UniverseId and not just the PlaceId or GameId. Also make sure that the variables, “Music”, and “MusicPart” are not equal to nil as this would cause a similar error.

One thing that I would try doing is making a new sound within the script instead of referring to a pre-existing sound in the game and parenting that to the workspace so that the sound can be heard. Sorry my response is so vague but I can only work with what I’ve been provided.

You can read this post on how to get your game’s UniverseId: here

Thanks for responding.

The whole modulescript works. So there are no errors in the output. I’ve just now figured out why it wasn’t working. I was playing the sound from the original model and not the cloned. The cloned model is the one that is in the workspace, meaning the sound wouldn’t be heard/played.

1 Like