Sound says that it's playing but it's actually not?

I have made a part that when touched will make you take damage and play a sound but the problem is that the sound is not working despite Sound.IsPlaying returning true and the IsPlaying box in the sound properties isn’t set to true during this which is weird

This is the script:

Script
local SoundService = game:GetService("SoundService")
local killpartsound = SoundService:WaitForChild("killpartsound")
local killpart = game.Workspace.killpart
local canTouch = true
local touchedCooldown = 5

killpart.Touched:Connect(function(Hit)
	local plrHumanoid = Hit.Parent:FindFirstChildOfClass("Humanoid") or Hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
	
	if plrHumanoid then
		if canTouch then
			canTouch = false
			local damage = math.random(10,90)
			
			if not killpartsound.IsLoaded then
				killpartsound.Loaded:Wait()
			end
			
			plrHumanoid.Health -= damage
			killpart.Color = Color3.fromRGB(77, 0, 0)
			killpartsound:Play()
			print(killpartsound.IsPlaying) -- It's true but the sound isn't playing
			
			wait(touchedCooldown)
			canTouch = true
			killpart.BrickColor = BrickColor.new("Dark stone grey")
			print(killpartsound.IsPlaying) -- It's returning false now and that means that the sound is done playing but it wasn't even playing
		end
	end
end)

As you can see I’m getting the sound from SoundService and using the Sound:Play() to play it and I’m also waiting for it to load by using checks to see if it loaded or not and if it hasn’t been loaded yet then wait for it to load then play the sound so what’s the problem here?

If you want to check if the sound that I’m using works in the first place then this is sound link which is made by ROBLOX: Here’s the sound

your studio audio might be muted. Test the game, go to in game settings and then chnage the volume to see if that was the issue.

My studio audio isn’t muted so that’s not the issue.

Parent sound to something to hear it.

I already have it parented to SoundService so that’s not the issue too.

Try parent to part, or try change volume
value.

1 Like

When I changed the parent of the sound to the part it now plays the sound but is there a reason why it wasn’t playing when the sound was parented to SoundService?

Sound service handling sounds, and making group of them. Also for loading them.

1 Like