Advanced Roblox Scripting Tutorial #25 - Teleport Service (Beginner to Pro 2020)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
alright guys is Deaf can hear back with a brand new video and guys welcome back to another one in today's video I'm gonna be teaching you about teleport service now exactly what is teleport service you may be asking well let me go ahead and show you okay so test it out I'm gonna go ahead and show you right it earlier and I'm gonna join this game and it's gonna tell the formation in the world I'm gonna be in this game right here and you'll see okay so I'm loading into this game right now okay and it's just a basic simulator map right pretty pretty nice I guess I don't know but oh gosh the shop sign fell okay it's a free model I just imported to test it out but anyways umm I'm gonna go ahead and touch this part and it's gonna teleport me to an entire another game well actually not on the game but another place so I touched it and as you can see it teleported me so now I'm in the quote-unquote nether okay I just needed like the nether but basically it's a good analogy right what I'm doing is a mock motion I'm not going to like another game it's the same data like if for example if I had a data store in that game this game going to have the same data store as well but basically it's it's another place okay so it's sort of like in Minecraft when you go from the you know like the actual like under overworld into the nether which is the underworld right so that's where we don't need aids video okay so what I'm gonna go ahead and do now is I'm gonna go ahead and X out of this and I'm gonna go ahead and make an entire new base plate and create all this from scratch okay so I'm gonna go ahead and get a new base plate right here and before you actually are able to teleport from place to place you need to have an actual published game so let me go ahead and publish this game so I'm gonna go ahead and go up here to file publish to roblox there we go and then I'm going to a great place and then I'm gonna call it the over the the mine the good world or there you go okay okay now keep it then and then unable to good world an okay place there we go and you know treat a place now it's on roblox and now and hit next and then done okay now that I have this right here what I'm gonna do now is I'm gonna go ahead and make a little thing right here okay so to distinguish is to distinguish this game from the underworld I'm not gonna make the whole thing again I'm just gonna go ahead and make a green part right here and it'll be grass so that way we know this is this is the good world right now I'm gonna go ahead and actually make the battle world or the nether okay so I'm gonna go to my game right here and if you guys don't have this go and go up to view and then go to game Explorer click on that and then you'll have it but basically this is um a little area where you can set your badges for your game or dev products all that stuff right and obviously your places so what I'm gonna go ahead and do is I'm gonna add a new place to my game now I'll show you what it doesn't a second but basically when I right click and do this it's not gonna make a new game but instead like a new map like an entire new workspace that's the best way to put it it's just like another it's like another map right so what I'm gonna go ahead and do now is right-click this rename it I'm gonna go ahead and name it the bad world there we go and nobody have that okay so now what I'm gonna go do it go ahead and do is I'm gonna double click this one and it's gonna open up this place in an entire new roblox studio session for me so now that I can edit this world and obviously it's gonna be a bit it's gonna be a Blake bass player right now but that makes sense could we just created it so I'm where I'm gonna go ahead and do is add a little piece of nether block well not another block I'm gonna add like a little bit of lava and then that way we know this is another world with the batterer world so I'll just make it no.not foil fabric there we go those are the only lava but you get the point right you got the point okay so now that I have this I'm gonna go and publish that real quick to make sure I'll save so I publish to roblox and basically now it just saved a roblox so if I ever join the game on the actual roblox page it'll join and also before I actually go ahead and do this - I'm sorry penis um as you can see here this is the start place the good world is the start place and you can tell that because you can see right here there's a little like spawn button or the spawn icon and that means if you ever joined this game which is the good world that's what the game's called you're gonna join this place which is also called a good world because the place the start place is the name of the game right so yeah basically and you can change the start place if you want you can change it to the bad world here if you just right-click and then hit market start place but we'd want to do that we want to have a good world start place so we'll keep that now it is okay so we're gonna do now is I'm gonna go ahead and make another part okay I'm gonna make a part and I'm gonna first of all rename this one to grass so don't confuse anyone and then I'm going to put in skipper so this part what I'm going to do is I'm going to make it so if they touch this part they're gonna teleport to the netherworld okay so it's like that like I imagine this part is the nether portal okay yeah so I'm gonna go and do local teleport service we need to get we need to get the teleport service first so I'll do local teleport services you go to game get service teleport service and then I'm gonna go ahead and do actually that's it I got that now so what I'm gonna go ahead and do now is I'm going to make it tell upward okay I'll actually no I need to do I get at the part too so I'll do local part is equal to script parent because I put this script it's at that part and then actually I didn't it gets it so if it's touch it'll part not touch to connect function and then also we need to put the hit so we're gonna make sure that the part that actually touched it was a human so we'll do local humans equal to hit a parent fine for child humanoid and just making sure to human right when it we checked the part that hit it and I check the parent of it and then check to see if it has a child called humanoid and if it does then we know it's a player so we'll do local char or what notice this character so your local chars equal to human or we'll do hit dot parent there we go okay that'll be have that we're gonna go ahead and they get the player we need the player in teleport for with so we'll do local players you go to game dot players and then there's a function of players called get player from character and it'll put the character in there and then there you go we're good okay so now we teleport so I'm gonna go ahead and do teleport service dot R : teleport and I think it's here it shows actually all the properties but if you hover over that you can see it says void teleport so doesn't return anything but basically the properties are or the parameters should I say the place ID okay so where D 1 teleport the player that you want to teleport the instance the player teleport data any data you want to send over and then a loading screen and now we're not going to do that this time it'll be way too long I'm making a constant loading screen but if you wanted to you can so definitely explore that if you ever want to it's pretty cool so yeah all right so we're gonna do is I'm gonna go ahead and just do teleport and then first of all like I said we need the place ID so the place I do you want to teleport is the underworld so we need the underworld of we're gonna the idea of this place right here okay now how do we did it well the easiest way to get it right now is just right click here and then hit copy ID to clipboard but if you weren't like if you didn't have this right here how you normally get place IDs is you just go to your you go to your game on the roblox page and then you just copy that right there and it's gonna give you the ID of the place and that's the ID right there right oh so yeah okay anyways now we're gonna go ahead and paste that in there cuz I have it I just right-click that it copy and then paste it in there that's a first parameter and then we need to paste the player okay so we already have it defined right there so it'll be player and then we need to actually paste or pass on any data so is there anything you want to send to this place before we teleport there's something we want this place to know about the character now before I actually explain this real quick whenever you send data guys all I'm gonna say is make sure that you do not send anything like cache so for example here's I need some data okay let me show you real quick alright so I'm gonna do local teleport local teleport data is equal to a table okay and then a lot of data a table of data and I'll do I'll do cache just equal to 50 now here's the thing do not do this if you actually had it I'll hit a statin or game called cache and that that you actually did like game argued player doubt leader stats that cache whatever the thing is do not do that the reason why is because this could be tampered with you can send data or you can actually even teleport from a local script right now we're doing from a server script but you can do it from a local script so that means that this data could be tamper with so do not send anything like cache or your XP or your level or whatever cuz that could be easily tampered with an exploit because any local script that you could send could be exploited okay so do not send stuff like cash what I'd recommend sending if you want to send anything at all is I would send something like you know something like is player crouching right like it's it's a little bit weird but but basically like if if the player is crouching then you could turn that over it right because like you wanted to say he want to make sure your player stays crouch when you teleport or are not crouched right so basically you can send that over and that's something like it's simple but like if someone were to exploit and you know change the data say they were crouching okay who cares right your I don't care you're crouching and you just said that in the script it doesn't make much of a difference for an exploiter or it doesn't make much difference to our game it's not gonna make that anyone's game worse or it's not going to make them any better if they start off crouching it just it would be nicer of a user experience if the player was crouching and they actually stayed crouched right that's kind of cool so yeah so stuff like that anything that that's local and it's gonna wipe or doesn't really matter then that's what you I would recommend transferring like I said do not transfer stuff like cache if you want to like find out how much cash a player has in the nether right you could actually just do reuse data stores and data stores aren't going to be the same across both places right because it's saving for one game but it's just different places so you're just you did it sort of that so yeah so yeah I would just save for a teleport and then you should be good anyways now that we have that we're pretty much good so what I'm gonna go ahead and do now is I'm gonna go ahead and I'm gonna go ahead and write a little script actually no actually will go ahead and teleport so I'm gonna go ahead and hit file then I'm gonna publish this and then we're going to go ahead and actually blue two-part game so let me go ahead and join it so right here I wanna join it also you fortunately teleport service doesn't work inside of robots to do so you need to make sure you just publish your game in or make sure you join your game in the actual game alright so now that we have this that's our teleport part right there so I'm gonna go ahead and touch it and we should teleport also use code tap yeah alright um they read guilt I live right here okay we're in the underworld now perfect it worked just like you wanted to do we are now here it is that simple um so yeah that's pretty cool and I like it a lot anyways now that we got here we still actually didn't get our data we didn't actually do anything with the data because we didn't write any scripts at all in the underworld there's nothing there's no scripts there at all so what we needed to do is actually write some scripts there so I'm gonna go ahead and leave this game and then we'll write some scripts here okay so what we're gonna do is we're gonna teleport back we can if you want to make a feature teleport back it's the same thing all you have to do is just make a place ID different alright obviously it's very simple you guys know you guys know how to do that now but anyway so we're gonna do is actually get the data to be sent over data so how you do that is you first of all get your teleport service so also make a local scrap do mate do it a local script inside of your store to play your scripts right here because it has to be local script to actually collect the data you set but you can you can teleport from a local script or service script so yeah anyways so local teleport service is equal to game not got service teleport service and then we're going to teleport service actually now we're gonna do local player so they put a game not players dot local player and then we're gonna do teleport service dot get player or get local player did teleport data and there you go and actually this is a function right but we just we need to make sure we save this to UM to a table so you have a self okay so we'll do local teleport data is equal to that and that's going to return this function e return into this a variable right here all the data we need so yeah alright so now we'll do teleport now if teleport data dot is player crouching is equal to equal to false then prints player is not crouching right because all we're doing is we're doing we're gonna table then we're doing table dots is player crouching because remember that's what we had save right there we did its player crouching so you tell them or date at flickering and then we said the false if it is false then we're going to print this so now when we're doing the game it should print that out in our console so let's go ahead and publish this to make sure it saves the roblox and then we should run the game and it'll work just fine alright now let's go ahead play and see if that works and also if you guys are wondering there actually is no console inside of your you know roblox game like I mean it wasn't I mean there's no output I mean at the bottom right so how do you actually read your prints let me go and show you so first time i teleport real quick then I'll show you but you need actually see what what we're printed right so how you do that you press f9 and it's gonna give you a developer console and it tells me about just useful stuff like this like memory how your games working is it laggy you know stuff like that so um useful stuff and I'll be explaining that's all this in one in a future video so make sure you subscribe for that one day anyways if you go into your log right here you can see it printed players not crouching so it worked the play the data was sent and players not crouching obviously if you wanted to actually have an actual good game you can make it so it didn't say that you'd make it so the player well standing and if it if the player was crouched then you make it so the player is is crouched right so that makes sense you make sure that works so yeah anyways that's how that works that's literally teleport service in a nutshell super easy stuff right ok now I'm gonna show you one more quick thing called reserves or reserving servers now basically what this is if you guys don't know reserving servers is basically it's how you get a new server so if you're gonna play to get like dungeon question like that and you know the teleports you teleport you to a new dungeon and a new place right basically if they were to just heliport in a new place they would have everybody in the same place but what you do instead is you make a new you reserve a new server so that way you join an actual new server in that place right how that makes sense so how you do this as you go ahead and reserve the server first and then you need to ya universe services that reserve the server first and then you can just teleport to it ok so here's how you do it ok so what we're gonna do is go ahead and go after place right here and I'm going to delete all this because you had it but you can sit up if you want I don't really care and then we can delete that too for now anyways so what we're gonna do is we're gonna go ahead and do well actually honestly I would show you guys but actually I'll show you anyways ok what's gonna what you would do is you would just let me save that stuff what you would do is you would just get the server or you would create like a server you would reserve a server okay so you reserve it you have to get a coat okay so you do local code or reserve I'm looking to have ever you want a reserve server code is equal to teleport service reserve server and then you pass in the place ID so we're gonna do this or will copy the bad world and we'll pay a visit right there all right so now we each reserved a server and basically what we did was we use this functional reserve server we passed in the netherworld and we're going to teleport to that server to this organic teleport your private server with that code and it's gonna put us in a private server now I have VIP server but a private server right yeah I think okay okay anyways so what we're gonna do now is go ahead and teleport to it so how you do it is you just do teleport service dot tell are : teleport to private server and now it's pretty much the same properties of of the what's it called of the teleport but you instead you have first of all your place idea once held ward - right wait reserved server access code returned by I'm reading the wiki or Nam I thought I didn't mess something up but reserved survivors co-chaired by a way actually this should be this if I'm reading this right it should be this that game about place ID so it should be this game's place ID so yeah that should be the desiccator code yeah that wait but doesn't make any sense because no no no no no okay I got to read in the first place okay copy your Cobra here copy this code out of the netherworld you copy that in here right and it's gonna give me the code for for that server okay isn't it see me code and then what you want to do is are gonna want to TP to that place okay so you new teleport service : teleport private server and then the place you want teleports you so that that right there and then you're gonna paste in your reserved server code because that's the code of the server and then you're gonna paste in the plugins helluva core players maybe for not add if you want players we do that now this is a server script so we'd actually have to go back and get the player from the part but yeah and then you wanted to tell where to spawn name or like where you wanted to spawn right you could heliport that and then you teleport the data so what did he want teleport with it you send that in last so basically I'm going to show you guys right now because it's not gonna actually show anything because there's nobody actually playing my game so it's not gonna put me in a new server to look like it just like I really it'll look like I just teleported regularly right because there's nobody actually played my game so if I wanted to though I could do that but um that I'm not going to this really no point I'm not gonna waste year at this time but yeah I'm also there's other things in teleport service like I haven't covered like I said there's custom loading GU eyes there's other things like you can teleport to a server right but it's gonna put you at you so at a certain spawn point so if desica that's gonna be teleport to or teleport to place instance right or teleport to spawn by name and then you're gonna put like the ID of the place and then you put like the spawn name so yeah anyway it stuff like that but yeah and if you guys that's pretty much teleport serpent because it enjoy it if you did leave like smash like button okay I appreciate it if you do and yeah that's pretty much enough reason to the video also I have a question for video ends for the you know the tired f king supporters out there um I actually have a nice kind of like face camp set up so if you want to use face cam let me know I might do that I don't know maybe make it better for you guys to watch I don't know honestly but I might use face cam if you guys would want that so yeah I'll let me know anyways I'm gonna end the video now see you guys and leave a like enjoy and keep on scripting yeah okay okay bye
Info
Channel: TheDevKing
Views: 53,996
Rating: undefined out of 5
Keywords: TheDevKing, Roblox Scripting Tutorial, roblox, studio, coding, tutorial, roblox studio, how to script on roblox, teleport service roblox, roblox studio teleport service, how to teleport in roblox studio, how to teleport players in roblox studio, how to use teleport service roblox studio, roblox teleport service, roblox studio teleport pad, how to teleport players to another game in roblox
Id: m3tO7Brpcwk
Channel Id: undefined
Length: 19min 49sec (1189 seconds)
Published: Mon Dec 30 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.