Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Get Local preloaded sound?

I have this script, which is a LEVEL up gui, that pops up when your leaderstats.lvl changes.

Anyways, i want it to make a level up sound. But where the sound is preloaded from a storage.

gui.Parent = player.Character.Head
for i=0.01, 6 do wait(0.025)

gui.ExtentsOffset = Vector3.new(0,3+i,0)

end

2 comments

0

Could you explain a bit more about what you're trying to do? Does the GUI part have anything to do with the sound loading?

0

See it as a level up sound. The gui is just a level up gui that pops up above a players head. This is just a snippet of the long script. But i want a sound id to be played as soon as he/she/it levels up. But last time i did this, i had to wait, because the sound wasn't preloaded.

1 answer

✓ Accepted answer

You want the Preload method of the ContentProvider service.

--stolen straight from the wiki; this puts the asset into the content loading queue.
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=12222058")

Put that at the top of this LocalScript, or in any LocalScript.

1 comment

0

This was just whatw i looked for! I just couldn't seem to find it. It might be because of my weird way of explaining stuff :/

This discussion is preserved as it was. New answers, comments, and votes are closed.