Advanced Roblox Scripting Tutorial #19 - Sounds and Music (Beginner to Pro 2019)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right guys it's defconn gear back with a brand new video and guys in today's video I'm gonna be teaching you about sounds and in roblox so basically what are sounds you may be wondering sounds are like you know how you play music and stuff like that you probably know what it is but I'm gonna be teaching you how to use them in today's video so yeah if you guys are interested in watching more scripted tutorials make sure to subscribe and leave a like if you do enjoy but anyways guys let's get into the video okay so first things first what is a sound okay so obviously you probably know it a sounded watching this video but a sound is basically you know it's like a sound and it's how you play sounds in your roblox game so yeah so basically how you use these sounds or how you make them so first things first you need to actually create a sound instance okay and you do that by going over to the Explorer and make sure you're making sure your Explorer is enabled so if you're if this isn't up here just double tap you go to explore right here click it and then it shouldn't be there and then you're gonna go ahead and click the little plus button and then you're going to go ahead and type in sound and now you can put a sound in the workspace you can put it in your rep storage or replicated first you can whatever you want really I I just put it in workspace to keep it simple I guess but yeah anyways No okay so how do I get a song I want to play so um you obviously if you have a sound you actually find out what sound you want to play so how you do that is you go to the website roblox calm okay and then I'll go ahead and just go to I'll bring it over I'll go ahead and just go to the catalog right here okay and then are not sorry not got a log create oh my god let's go and go to create and then we'll go to library and this is like everything public and then right here you can see we have all our audio if you click on this right here and go to audio you can see all the audio and the most popular ones are right here so we can go listen to one we can listen to Alan Walker feed you probably heard this song a million times in your life let's do it one more time okay probably know that I'm sure you do sorry sounds a little loud it's loud for me too okay I don't know what that is but anyways you get the point they have a lot of music on here and you can use it in your game if it's on here I guess I don't okay so there's something you need to know when uploading sounds like it may be against the rules to you certain sounds like for example like this song like moonlight right like this probably isn't good to use in your songs if you want or good to use in your game if you want like to make sure you don't get like soot or anything because like in the long run if someone finds out you're using their songs and you aren't giving permission and it's not royalty in copyright free then they could I gotta sue you kind of but it probably won't happen but if you if you're planning on making a really big game you want to make sure everything's good I would recommend either finding royalty-free music or just making your own music that works too so yeah anyway it's really easy for this example we're gonna find some Kevin of MEK Lloyd music actually honey's pros name I don't even know this is gonna pop up I don't think so oh there it is okay um let me see that's not playing okay I think that's playing basically Kevin low if you guys don't know who he is he makes a lot of music and it's all that copyright free I actually a lot of him loves music in my other videos but yeah anyway so we're gonna go ahead and pop this bad boy right here into our studio so we're gonna click on this audio regular ever all you want to use and click on it and then go over here to the top or top of the link and you'll see this little slash library slash your coach this is the audio ID and that's how you actually play it um also if you want to make your own audio you can go ahead and go to the oh that don't worry about that now you can go ahead and go to the create audio page so how you do that is you go ahead and go over here I'm gonna create a new tab so I don't lose this but you go ahead and click on create right and then you go ahead and go over to audio right here and I've actually never appalraju before and then you go and pick your file I'm not gonna click it because I don't really have a file when I upload but if you wanted to you that's what you do and then the prices do range I'll show you right now don't worry about that anyways so the audio is right here let me show you so these are the prices okay I'm sure to bring it over like this and as you can see here you have 0 to 10 seconds so you have 10 to 30 seconds and then you have 3 minutes 30 seconds to two minutes to seven two minutes to seven minutes and basically these are the prices for the audio pretty simple stuff there's a wiki or you can read all about this if you want to again I don't link in the description if I remember so yeah alright anyway so now that you have that what you're gonna want to do is go ahead and go back to roblox if you uploaded your audio copy the the ID right there and then go ahead and copy that and go back to roblox to do and here now what we're gonna do is we're going to click on our sound right here and we're going to paste in the sound ID so press control V hit enter and then it's going to put the little RBX asset for you right there that's what you need to do to like set it all up and then actually gonna hit preview right here to play you're gonna preview already and then you can change the volume all obviously volume does that so your students a 1 right now it's at point 5 and now it's little louder we set it to 5 this might be your rape so sorry about that anyways you get the point that's what that is and then you have stuff like roll off mode this is like how it rolls off so yeah I can look more that's kind if you want to and then you have sound group you can make groups of sound if you wanna do that there's a little fingers as playing so like basically this you can't really change that and whenever you're like you know using this I mean as you can like set it and then it'll play once the game starts but basically the playing little properties basically checking if it's playing and it's not how you play it but it's how you can check so you can like notice what's playing playback speed obviously you can play it at two times P if you wants to play a little bit faster will keep it out one for announce to default and then you have max distance if your game or if your sound is inside of a part right so the keyless leave an in-game radio like a little part radio right you put your sound in the part and you see it's only gonna play ten thousandths does away for ten thousand you know distance from that area right so that's pretty cool you got a little radio I'm not gonna do that for now but if you want so you can yeah well so we like the sound here and then you have looped so if you wanted to play again and again and again again and then and loop itself and then that's what it does emitter size is how you like kind of make the size of it I'm not gonna lie not really sure what that does kind of forgot but you can look it up if you want to is loaded check see if the audio is loaded is paused obvious detection the audio is paused and then in is playing checks if the audio is playing okay pretty so much memory stuff now if we were to go ahead and start the game it wouldn't play but we're gonna go ahead and insert a pretty simple script and make it play so we're gonna go ahead and go over here to explore go to server subscribers and clean on this little arrow or plus sign right here i'm gonna type in script okay and then i'm gonna go ahead and type local workspace or actually will do local sound okay is equal to game down or expanse and there you go and then we're gonna do sound play okay and that's it that's all i have to do and now this is pretty much the bare minimum how you play audios i'm gonna show you a little bit more in depth in a second here but if this is all you want to do what goes in play that's how you that's not what's playing in here [Music] okay it's that now next what you normally want to do with audios if you want to make a really good well-built game is actually load the audio first and now this isn't really I guess this isn't really a tutorial on content provider but that's how you do it you use um this a service called local your local content provider or actually we'll just do a game get service the service is called Connor provider that's their right and basically you new content provider preload ass preload a sync okay that's what that's what the functions called and then you just yeah you just put your sound ID in there and basically whenever your sound first plays it needs to actually load so it doesn't start loading until you hit the sound play function or until you actually play it once you play it then it'll load and then it'll play but if you want to make sure there's no delay or anything you'd probably want to make sure that you load it first that way when you hit play and it takes a couple seconds to load or however long if someone has a slow PC or slow down low speed or whatever you want to make sure that it's already downloaded and ready to play that way is known to lase and your audio there's no like kind of like yeah it delays so make sense right so what you would do is just go ahead and do like this function here that's it you probably it look a little bit nicer you'd probably do like local content provider is equal to game get service content provider and then you'd do constant reminder preload async right and now obviously if you had a lot of sound in your game like if you had a lot of sounds you probably wouldn't want to just do like copy this and do this and this and there's none of this right probably get pretty repetitive so what you normally do is you make a table right so you would loop through all of your sound IDs and normally to have them like a fold and reps relegated storage so you can have like a roll in here I don't do this right now I'm just I'm demonstrating you can just call it music whatever sounds and then you put it in there and then you just loop through he just loop through that so you do game rep storage sounds get children right and then you would just do V dot pre or not you just do actually preload or no content provider preload is sync audio or no sorry yeah sound or V sorry B there we go and then it would load it all for you in a loop and you would have to type that anyone we'd have to paste this all out but obviously you might wanna you might also not want to you know create a new sound every time to make it a little repetitive to you and what you might want it might not want to create a new sound cuz that get repetitive you have to feel like doing sound sound so you could probably just put it like the asset ID is in a table and then create the sounds that's what that's what I did and I'll show you a little quick example here but basically as you can see here in this little mate this might look a little confusing for some people who are new to scripting but basically what it does is it just loops through a table or like you'd have like a you can put all of your like you know like music in a thing right you could put like assets we'll call it assets right sorry we'll call it will call it audio audio list okay and then you would just loop through it all you can make a table and then you could put you know the name of your song whatever you want to name it fade and then you could put the name of the ID which could be that okay and then you'd obviously just copy it over ace cover it over and then change this to your you know lucid dreams okay and then you just type the thing I have a thing there okay you get the point and then you could just loop through that create a new instance for it set the sound ID you can do audio instance an ID is equal to RB x asset ID and then concatenate it because you need to put that first and then you name it put it whatever you want and then you can put it in a table and then and then you can also go ahead and load it like that or you can load preload async this also takes table values too so audio list and then it would load all your audio see ya also by the way you do this in a client sorry so yeah if you would load your audio in the client so that would be in a local strip if you did inside a load your audio I'm not gonna go into detail on that because it most people probably won't need it but and like I said this isn't a content provider tutorial but you would probably put that in a local script and maybe set it up through modules well like I've set up this function through a module so you can have a table and stuff like that so yeah anyways guys it's pretty much under the datoria I hope you did enjoy it if you did like always subscribe okay sorry miss Tori was a little bit rushed I'm gonna kind of a hurry right now but anyways I hope you enjoyed it and yeah yeah use code tap okay I have a star code use code tap when buying robux okay um or premium and yeah that's all I can say anyways okay so anyways I hope you guys enjoyed the video if you did leave a like subscribe and I will see you guys in the next one script on a cam I don't say that just just just keep scripting okay that's what I'm gonna say that's that supermodel I should get that a thing keep scripting although there wasn't much shipping in the tutorial it just was kind of basic pleasure to win in the beginners series but whatever alright fees
Info
Channel: TheDevKing
Views: 38,574
Rating: undefined out of 5
Keywords: TheDevKing, Roblox Scripting Tutorial, roblox, studio, coding, tutorial, how to script on roblox, roblox studio, roblox studio tutorial, how to script in roblox studio, roblox studio scripting tutorial, how to make music in roblox studio, how to upload sounds in roblox studio, how to put music in roblox studio, how to put music in roblox game, how to put music in roblox, how to make sound effects in roblox, roblox sound effects tutorial, roblox music tutorial
Id: gjjHBkxyPj4
Channel Id: undefined
Length: 13min 33sec (813 seconds)
Published: Sat Dec 07 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.