Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Get Local preloaded sound?

Asked by
iNicklas 215 Moderation Voter
8 years ago

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
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? nicemike40 486 — 8y
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. iNicklas 215 — 8y

1 answer

Log in to vote
2
Answered by 8 years ago

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.

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 :/ iNicklas 215 — 8y
Ad

Answer this question