Function works in Studio and not in game

This function works in Studio and not in the game. No errors in console. This is basically a donation board that my friend gave me and I modified it. The function clones a sound, places it in a folder in SoundService and is destroyed after it finishes playing. I’m so confused

Function being called (global)
image

The function itself

Note that these sounds were working as intended until very recently

Hello! From what I can see, this looks like it could be a permissions issue. Do you know who owns the sound?

If you are the owner of the sound, could you print the status of the so you know when the sound is playing?

local sound = [ WHERE YOU SOUND IS STORED ]
sound.Played:Connect(function()
	print("Sound started playing")
end)
1 Like

The sounds are from the Creator Store meaning anyone can access these sounds

also I should clarify that the main issue is these Sounds don’t appear in the folder at all, nothing to do with permissions or the SoundIds themselves

1 Like

My apologies, let me have another look for you! I thought that they did not play.

Add --!optimize 2 at the top of the script to test better

Reason edit: it’s 1 by default, not 2 unlike live action

It looks like the sound hasn’t fully loaded because if the TimeLength is 0, this can cause the sound to be deleted immediately, even before it plays.

You can try to fix this by doing the following

instead of task.wait can you do ClonedSound.Loaded:Wait()

this causes the donation script to not work at all

Then it’s a problem with the audio you have identified the issue, try and use a different sound. To see if it works.

replaced task.delay(ClonedSound.TimeLength / ClonedSound.PlaybackSpeed),function() with ClonedSound.Ended:Connect(function() - this should probably work for now