SoundService:PlayLocalSound() is not working [SOLVED]

When I tried to play a sound using PlayLocalSound() nothing plays at all.
Video link of bug:

Is there any way to fix this? It worked yesterday, now its not?

Here is my code I don’t why it doesn’t work at all

UserInputService.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.Keyboard then
		if input.KeyCode == Enum.KeyCode.Space then
			if AllowAudioPlay == true and AudioCurrentlySelected ~= nil and AudioCurrentlySelected:IsA("Sound") then
				if PreviousAudio ~= AudioCurrentlySelected then
					PreviousAudio = AudioCurrentlySelected
					
					--AudioCurrentlySelected.PlaybackSpeed = 1
					SoundService:PlayLocalSound(AudioCurrentlySelected)
					print("play attempt")
				elseif PreviousAudio == AudioCurrentlySelected then
					if AudioCurrentlySelected.PlaybackSpeed == 1 then
						--AudioCurrentlySelected.PlaybackSpeed = 0
						print("pause attempt")
					elseif AudioCurrentlySelected.PlaybackSpeed == 0 then
						--AudioCurrentlySelected.PlaybackSpeed = 1
						SoundService:PlayLocalSound(AudioCurrentlySelected)
						print("play attempt")
					end
				end
			end
		end
	end
end)

Edit: I’ve tried playing the sound manually using the command bar, yet nothing seems to play at all

1 Like

It didn’t work for me too, I just ended up playing sounds using RemoteEvents and firing it client-side

2 Likes

Oh I forgot to delete this topic, but thanks for your help. I already managed to fix it not by using a plugin widget!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.