Sound wont play inside of handle?

Hello, this is like really weird because I’ve never encountered this bug before…

Basically, I have a script that just plays the sound. In this case its

Tool.Equipped:Connect(function ()
	CastParams.FilterDescendantsInstances = {Tool.Parent, CosmeticBulletsFolder}
	


	
		script.Parent.Handle.EquipSound:Play()
end)

image
the green is the script and the red is the sound

however for some reason instead of playing this sound, it just doesn’t?

except… in workspace it plays… I dunno why.

I have another tool that plays sounds (by removing them) and it plays them
Heres a video for you to know im not schizo

External Media

I looked on the dev forum for anything else like this, so I would really appreciate if I can get any clues on why this wont work (also, there isnt any other script that interferes with this singular sound)

Maybe a very short wait before playing the audio would work?

hey, first, check if the volume isn’t 0.
Next your sound instance might not be loaded when the script runs. check if it exists.
if that doesn’t work, then the contents of your sound might not be loaded yet!
check the sound.IsLoaded property to see if your sound is loaded, you can also load it using contentprovider:

local contentprovider = game:GetService "ContentProvider";
local sound = --your sound

contentprovider:PreloadAsync({sound})--yields the thread until all items in the array are loaded.

the contentprovider will preload your sound, so that it is ready to be used.
as I said before you can check the sound’s IsLoaded property:

print(mysound.IsLoaded) --true or false?

and you can connect to its loaded event to do something when the sound is loaded:

mysound.Loaded:Connect(function()
print "Loaded!";
end)

But it’s better to just preload your sounds using contentprovider.

I’ve done what you told me to check if it was loaded, it returns with true, I also preload it just in case but it still doesnt play…

I also checked the properties and it isn’t zero. And just in case I decided to play to sound manually using the command bar, yet it still doesn’t play.

Okay, back to this, I just made a clone of a brand new sound instance and it works when i remove it to play sound? so i decided to clone the equipsound and it just doesnt work.

so THEN i decided to make a completley new sound instance rather than the equipsound already in the handle then i just added the audio and made the script play and that and now it WORKS???

I doubled checked like the properties of the sound and nothing was different from the equipsound

and i also double checked the equip sound with a already working sound and nothing was different (I didn’t even double check it, i like 20x checked it cuz it was driving me insane)

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