This works in studio, however, not in game?

Sound = script.Sound
game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(Message)
		if Sound.IsPlaying == false then
		if Message == "oof" then
			Sound.SoundId = "rbxassetid://879938225"
			Sound:Play()	
			end	
		
		if Message == "england" then
			Sound.SoundId = "rbxassetid://884947413"
			Sound:Play()	
			end	
		
		if Message == "john cena" then
			Sound.SoundId = "rbxassetid://615300105"
			Sound:Play()	
			end	
		end
	end)
end)

4 comments

0

Try using the bool IsPlaying and set it to true instead of using :Play(). I always have issues with it

0

That's really bad advice, and IsPlaying is read-only...

0

Any errors/warnings? Try Sound = script:WaitForChild("Sound")

0

@Programical No Errors, and that doesn't solve anything.