Advanced Roblox Scripting Tutorial #34 - MessagingService (Beginner to Pro 2020)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
alright guys welcome back to a brand new robust urban tutorial and taste video actually teaching you guys about row blocks messaging service okay now this is actually a lot easier to the people think like a lot of people say that messaging service is hard to understand and confusing but there's really only two main functions and it's pretty simple so I don't know people to think that but anyways I'm gonna spend it very quickly for you guys and very simply and the best way possible that I think alright so if you guys are messaging services first of all basically messaging service is a service where you can communicate between servers in real time okay so less than one second now basically the which this is really cool right because the possibilities are like literally endlessly you can make you know global leaderboards that can change you know every second really if you wanted this you know I'll probably play I wouldn't want to do that but you know I'm saying you can change the leaderboards every so often in real time without having to shut down the server anything like that you know I'm saying and you can communicate with other servers in real in real time so that also means you can even like like you can have like a server wide chat right like our liking you know I'm saying like a cross server chat you can chat we can chat with other people even if they're not and you're in the same server you can also have like server browsers you're not saying that can be kind of cool and then like global announcement like for example like you know there's like a vents and jailbreak or there was at least I'm not sure I don't really play that I might want to said I don't know if there is but anymore but like for example like what if it was like a challenge in your game right to find the special item and if you found the item then everybody and then in the game could know because you could put announcement up like oh this guy found the special item and he's only one house you know I'm saying like stuff like that but be pretty cool alright so anyways I'm gonna go ahead and tell you guys how to use this and how this all works alright so first things first is according to insert a strip of Joe service room service alright and I'm actually gonna make two scripts make it simple because I could put more than one but it would get confusing pretty fast and and yeah anyways okay I'm okay I'm making the trip down here okay I'm gonna call this one just subscribing and then I'm gonna call this one down here um publishing I know it might sound a little weird like subscribing like YouTube scribing it actually kind of is like that honestly but don't worry about it for now alright so just only have this one open for now just describing one okay anyways so what is massing serpent house will works right like I just said I explained that just now for you you know it allows you to communicate less servers in the same game in real time which is very very cool alright so first things first we have to actually get the service so we'll do my local messaging service equal to game but get service or calling a service messaging service there we go and then we're gonna go ahead and do messaging meet yeah okay we're gonna go ahead and do messaging service subscribe async global no not global what could we do how am I actually yeah will do it'll do an announcement right so will do yet global um actually I'll just do announcements okay and there we go alright so now everybody in the server's gonna get this nothing okay so like she will name it like player found item announcement now we're actually not gonna have the actual item I could have killed that in but I would take a little lot longer I'm going to explain just you know I'm a teacher before this tutorial are anyway so then we have to go ahead and insert a function into our our thing right here so we'll do a local function and then we can just type I guess message in here and then there we go and then let me leave that extra privacy all right so there we go all right so and now we have everything here alright so actually let me make that message like the right way cuz I'm pretty sure it's just you know sometimes I make more sense all right there we go alright now basically how this works let me explain it for you alright so how many service works is basically when you have a messaging service okay you just when you have messaging service there's two main functions okay there's subscribing some sort of subscribe async and then there's publish a sync okay and then basically you have to subscribe to a topic which is this right here okay I put the first parameter this right here is a topic okay and basically this is the topic that you subscribe to and basically what happens is you're now able to subscribe to this topic and then if you publish to it or if someone publishes to it then they're gonna get that announcement so yeah so this is the subscribing one so we'll all we're gonna do is subscribe to it okay and then we're gonna print out if a message is sent right then we're gonna do message data we're pretty much just data and then we can do method time as well because oh no no sorry it's not much that's not print message dots sent okay and that gives me the time it was set so yeah now obviously if usually if you run stripper now nothing's gonna happen because we actually didn't even subscribe to we did subscribe to this we would be crown'd we're now subscribed to this topic called player found item announcement okay that's I like people tell like they're supposed to reference to it's called a topic alright which is just a string pretty much and then it's like you know an important string to make sure exactly the same alright so yeah that's the string okay so now we actually need a publisher because right now we're subscribed to it but if and if we don't get any anything published we're getting notifications they're saying think of like a Youtube notification system I just totally fast thanking for like a YouTube notifications you have to system okay like if someone publishes a video then you get a message sent to you but if they don't publish and I'm not gonna get any messages so when you actually go ahead and publish to them and if you you know if you subscribe to them then you get the message sent to you and when they publish all right anybody's go to the publisher skip right here and then we'll just go ahead and redefine this like who doesn't the same script obviously oh I'm hurting I'm trying to make it simple so I'm not going to you and then we're going to do messaging service and then we need to publish okay so messaging service publish I don't know one sec okay we're gonna do message service publish a sync okay and then we're gonna go ahead and print or the topic okay we need to put the topic in here that's the first thing so the topic will just copy and paste it make sure it's exactly the same alright we don't to mess that up and then we're gonna go ahead and put a comma and then we're going to put the message one to send alright and the message want to send it I'm pretty sure it can only be a string up to 80 characters actually know the topics can only be 80 characters so right I'm pretty chick about whatever you want in here but actually I probably figure that out if you put unique important thing you want in there it's a variant message it says I'm looking at the dev forum right now okay so it's a very I'm pretty sure you can put anything out but we're gonna put a string in there for now all right anyways so now we're going to go ahead and do is yeah it's a tube okay you can put anything you want in there all right anyways so now we're gonna go ahead and do is put our string here which will be our announcement and we'll just call it player has found the item and there we go and now they'll know players on the item so that's all you're to do this is it just publish and then you're good alright and then we're gonna go back here and then it's gonna print it out whenever it's actually found something so I think you've run the game right here it'll work just fine as you can see oh messages message rooter service disconnected okay you're waiting to publish our game that might be the issue I'm sorry guys okay go ahead polisher game real quick just to make sure that's not it do a quick publish here you go great new plays perfect publish next next okay and then let me actually go to the game settings real quick and make sure everything is enabled on all the api's um there you go was that right okay I was correct yeah I bad guys makes publisher game before hand or else you have a little here anyways um actually biking on that script back now let me actually go into control to do that let me see if that works but doesn't work I'll just recently console which was my idea in the first place alright let's go ahead and see that works and then as you can see here it didn't work okay alright it's fine it's fine guys don't don't worry it's oh okay the script was empty that's why alright one second let me put this back mr. dink service there we go messaging service publish async and the topic and the player has found the item okay there we go and then this should work I think all right there we go it worked okay awesome that's message service now this would actually print out an any server I know we're only in studio right now but this would print out literally any server so actually every server because they all the same separate all servers are the same actually well that's not that's not sure because if a server started before the game was published on different update that one in the same so that's not sure but anyways the point is if as long as the server will subscribe to this message or this topic which is player found an item announcement then it would work now if I were to change this topic right here even like I misspelled like a letter okay or if I like Miss or like hey I put a lowercase a for announcement it's not gonna work and you'll see why in a second here but that's because it's not the same topic name the top it needs to be exact okay it's like following an account it needs to be the exact name I know that actually like in most accounts you don't really matter to the exact name but you go and I'm saying even the capstone that may matter on this okay so make sure the caps everything is exact same to the topic message remember most time you can just put like your string up here like local topic one is equal to and then you can just copy that to your thing right here and then just pass through topic one but you know whatever works for you it works for you anyways guys are pretty much it though we enjoyed it now this is a pretty simple kind of explanation of missing new service but is it that's literally how you do it it's that simple I hope you guys do the video if you guys did like always make sure to subscribe smash the like button and that's pretty much it that I'll see in the next one alright peace
Info
Channel: TheDevKing
Views: 20,040
Rating: undefined out of 5
Keywords: TheDevKing, Roblox Scripting Tutorial, roblox, studio, coding, tutorial, how to script on roblox, how to script on roblox 2020, roblox studio, roblox studio 2020, messagingservice roblox, roblox messagingservice, how to use messagingservice roblox, roblox messagingservice tutorial, roblox studio messagingservice, messaging service roblox, roblox messaging service, advanced roblox scripting tutorial
Id: XLBvKyCHqA4
Channel Id: undefined
Length: 10min 4sec (604 seconds)
Published: Mon Feb 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.