Scribe
Scribe

Gostou? Torne o Scribe ainda melhor deixando uma avaliação

Obter Extensão do Chrome

Navegar

  • Vídeos Populares
  • Vídeos Recentes
  • Todos os Canais

Ferramentas Gratuitas

  • Baixador de Legendas de Vídeo
  • Gerador de Marcadores de Tempo de Vídeo
  • Resumidor de Vídeos
  • Contador de Palavras de Vídeo
  • Analisador de Títulos de Vídeo
  • Busca de Transcrições de Vídeo
  • Análises de Vídeo
  • Criador de Capítulos de Vídeo
  • Gerador de Quiz de Vídeo
  • Chat com Vídeo

Produto

  • Preços
  • Blog
  • Obter Extensão do Chrome

Developers

  • Transcript API
  • API Documentation

Legal

  • Termos
  • Privacidade
  • Suporte
  • Mapa do Site

Direitos Autorais © 2026. Feito com ♥ por Scribe

— Se isso tornou sua vida mais fácil (ou pelo menos um pouco menos caótica), deixe-nos uma avaliação! Prometemos que vai alegrar nosso dia. 😊

Related Videos

Teleport Service (Teleporting, Servers, Send Data) - Roblox Advanced Scripting #26

Video thumbnail
12.21k9,067 Palavras45m readGrade 18
Compartilhar
Channel
BrawlDev
damn I can't even play this game until I have another person inside of this pad for this matchmaking system oh my God what am I going to do about this oh wait wait I see a player hey you bro over there huh yeah I'm talking to you bro come over here I need another person so that we can actually play this game all right we got two out of two players so now let's see oh all right we're going into the next game oo let's see what this game is about to be like uh what
am I in hell right now bro this is kind of weird is this what Roblox games be like nowadays oh my goodness this is um this is quite an interesting place both of us landed into all right but what you just saw was a teleportation from the main game that we were just playing on to this other alternative game that's really strange but uh that is essentially what happened we got into a Teleport matchmaking system and then we got teleported to another place within the same exact game and this is using a feature called teleport
service that essentially allows us to teleport players between places within the same game and do other cool neat features with it like sending data over uh to other servers and joining specific players into specific servers and things like that so in this video I'm going to be showing you how teleport service works and how you can implement it inside of Roblox Studio but let me try and explain more of teleport service before we get into implementing so let's go straight into that all right let's think about this for a minute I'm going to try and
explain the concept of teleport service so that we can get a better idea of how this works and why it's important for us to know uh how to use this inside of Roblox studio so with the example that I showed you in the beginning of this video we had a matchmaking system over there and once we had enough players we were teleported to a different place within the same game that had its own contents that was not available inside of this main game right here um and this is using uh the ability that we have
as developers to teleport players into a different place within the same game and so the way I want you to think about this is if I were to open up Explorer we have everything inside of here that comprises of a game with its own properties and things like that so what you're seeing right now is the main game but if we were to teleport to a different place then this uh game would basically be reset back to its defaults and we can add whatever we want um inside of this game that's going to be different
from this main game and so that's how I want you to think about this in terms of different places within the same game and so now I want to show you what this looks like conceptually so what we have going on here is the game itself and this game can be comprised of multiple different places attached to the same game so uh as we've been following along through this Advanced scripting tutorial guide we've basically just been having one place be connected to the game and so so with the ability of teleport service we can create
as many places as we want attached to the game itself so what I want you to understand is there can only be one game but there can be multiple games attached to the same game if we want to teleport players between each of these places and so now I want you to understand how creating servers work inside of this structure so how how do servers work when players join into the game we need to be able to create a server for them to be able to join into this game as you probably know so what
Roblox decides to do is create a public server uh that's open to anybody who joins into the game to then be thrown into this public server as long as there's enough players that um don't reach Max Capacity or whatever so uh the players once they join to the game they join into the main place now if let's say we wanted to have the players join into another place like if we were to teleport them to the second place we need Roblox to create another public server so that these players can be teleported over to This
Server inside of the second place so we're going to use teleport service to essentially move the players from this game or from this place into this place over here and if let's say we teleported everybody then we then this is just going to be an empty server and Roblox can just remove this public server because we don't need it anymore and so this is essentially how server hopping or server teleportation works inside of Roblox Studio within different places and we can basically just do the same thing with Place three as well if we created a
public server then we can uh send the players over to this place and you kind of get the idea at this point so that is how server teleportation works but what makes this interesting is that we can have different server types for players to teleport into this game so uh another type of server that's interesting to know about is reserved servers and with the name reserved servers basically what this is is if we let's say had players uh back from the main place like this uh if we wanted to teleport them to an exclusive server
inside of this place so that if future players came into the main game and wanted to teleport to this place then they would not be able to be uh joining inside of this Reserve server because this is only exclusive to the players that were sent over to this place uh from the beginning so if we sent the players over to this reserved server then no players up until this point like if let's say we had more players here they cannot Join This Server because this is a reserved server they can only go to the public
server um that is created for them inside of place two or if we created a new Reserve server for these players to play inside of the game I hope this is making sense to you uh this is basically the idea of how teleportation Works inside of a game within different places um there can also be other things things like sending data over between different places but I'm going to go more into detail of what this entails later on inside of the video and that is essentially the basic structure of this now with teleport service you
can even teleport to uh thirdparty games that are not included within your game itself like let's say we had another game here with adopt me or another game with pet Simulator X then we can send the player from our game to that uh like alternative third party game as well with teleport servers but for the sake of this tutorial I'm going to resort to just teleporting between different places within the same game that we own so I hope this has made sense to you and with that being said let's go ahead and get straight into
implementing teleport service inside of Roblox studio now that we understand it let's Implement teleport service inside of Roblox studio now as I explained earlier we need to be able to have multiple places within the game so that we can teleport these players between these places because by default when you create a a game on Roblox um there's only one place attached to it which is just this main game right here but now we have the ability to create multiple places that connect to the exact same game and the way we do that is by going
up to view and we're going to be clicking on asset manager over here and there's going to be a bunch of these folders here that we can create as assets to be used inside of our game and the first one on the list is places so we're going to double click on this and there should be a a list of all the games or all the places that we have contained within this game so what we're going to do is create a place within this game right here so we're going to Simply right click on
this and we're going to hit add new place like this and so Roblox is going to generate a new place for us that's now attached to this game that we're playing so if we double click on it then what should happen is Roblox studio is going to open up a new window that's going to be reserved exclusively uh or not exclusively but specifically for this game that we are creating so I'm just going to let Roblox Studio load this up really quick uh so that we can be connected into this new game and so now
as you can see once we are loaded in we have a fresh base plate to work with and if we go to places we can still see that these places are connected with each other just ignore this one test place one for now just pretend that there's two places here so one for the main game and one for the place that we just created so this name for this place is kind of weird so so what I'm going to do is right click on it and hit rename so we're going to call this place two
just to keep it simple uh so now we have place two and the the main game so we can actually just rename this to main game just to make it simpler so we have the main game and place two so that should be uh what we are working with as of right now okay and that's pretty much all it takes to create the second place uh within the same game so now what we're going to do is teleport the player to this place through script all right so I'm back into the main game and here's
what we're going to do we're going to go on the right side of server script service we're going to hit the plus sign and we're going to insert a script so the first thing we're going to do is make reference to the service that we're going to be using which is of course teleport service so we're going to say local teleport service equals game colon get service open and close parentheses teleport service like this now there's two pieces of information that we need in order to teleport the player into um this this place so the
first one is specifying exactly which place that we want to teleport the players to given their place ID so what we're going to do is go to our asset manager for place two we're going to right click on it and we're going to hit copy ID to clipboard so we're going to click that and then we're going to create a variable so that we know that this is the ID that we need so we're going to say local place ID equals and then we're just going to paste um the ID like this and so now
that we have the place ID we need to specify the player that's going to be teleported or players in this case and an easy way we can do this is by making a player added event so that as soon as the player joins into the main game they're going to be teleported to the second place right away so what we're going to do is drop two lines and say game. players. player added colon connect function open close parentheses we're going to pass in the player argument and we're going to hit enter so what we're going
to do is now say teleport service colon teleport async open and close parentheses and we're going to pass in the place ID and we're also going to pass in the players that are going to be teleported so in this case we're going to say player now there is something you have to be careful about this this is the first thing people get tripped up about and that is this takes in a table of players not just one player we're not just passing in one instance of the player to be teleported we need to pass in
a table and so what we need to do is wrap this player in curly brackets to indicate that this is a table with one L that this is a table with one player inside of it and so this is a common thing people get tripped up about and you and you need to make sure that you have this taken care of okay great so this is basically our script right here but in order for us to test this script unfortunately we can't do this inside of Roblox Studio we're going to have to publish this game
to Roblox so that we can play it in the game so that we can be teleported to this next place so what we're going to do is go on the top left hit file and we're going to hit publish to Roblox and if this is your first time publishing it just make sure that you create a new game um and have it be published to Roblox basically so another thing we need to make sure is to go to our second game like our second place and also publish that as well so we need to make
sure that that is taken care of as well all right so we're in the second place hit file hit publish to Roblox and that is essentially taken care of now so what we can do now is go into the the actual game and test this for ourselves all right so this is what my published game looks like so I'm just going to hit play and then once we join into the place it's going to teleport us as soon as we join into the main game all right so I've now loaded into the main game after
waiting for a bit as you can see the game has now teleported us to the second place that we specified um as soon as we joined into the main game we've now been teleported to the second place so it's basically working as expected this is the basics of using teleport service to teleport players from one place to the next so now that we know that teleporting Works another thing we can do is create our own loading screen or transition screen from one place to the next so uh we saw that when we teleported Roblox used
their own default loading screen but we can replace that with our own loading screen if we wanted to and here's how it's going to work so we're first going to create it in starter GUI so we're just going to hit the plus sign and we're going to insert a screen GUI we're going to call this teleport GUI and and we're also going to check ignore GUI inset so we're going to check this off and what we're going to do is hit the plus sign create a frame we're going to surround the entire screen with this
Frame so we're going to set the size of this to 1 comma 0 comma 1 comma 0 like this and we're also going to change the background color to something dark probably like around here and we're also going to insert a text label inside of this Frame and we're going to move this text label uh down here and we're also Al going to drag this out just a little bit so that we can see it nice and big and we're also going to align this probably like somewhere down here so we need to make sure
that the size is also using scale instead of offset so we're going to uh change these properties to zero and we're going to make the scales probably like let's say um 0.2 and we're going to make this one 0.4 for the Y um or not we could just scale it like this now that we know that we're in the scale off that we're in the scale not the offset okay so now that we have that taken care of let's go down here let's uh scale the text like this let's change the text color to white
and we're going to change the text to loading dot dot dot just like this and let's go back up and change the background color of this to something even darker than the the frames color so it's going to look like this and now we have a basic teleport um loading screen G thing not the best thing but it's something to work with so now that we have this we need a place to put this teleport GUI uh for for us to be able to access to be able to set this GUI so we're going to
move teleport GUI into replicated storage now the thing about this is we have our teleport GUI but we need to be able to set our teleport GUI to this GUI in particular and the way we're going to do that is by creating a local script and having teleport servers set this GUI as the loading screen so this can only be done on the client as well so we need a place to put this local script so that we can access this teleport GUI so we're going to open up starter player and we're going to make
a local script inside of starter player scripts so we're going to search up local script insert this and we're going to go back to our original script copy this reference to teleport service and we're going to insert it into here so now what we're going to do is also make reference to the teleport GUI so we're going to say local teleport guy equals game. replicated storage wait for Child open and close parenthesis teleport guy like this and so all it takes is just one simple method and it's simply just teleport service colon set teleport GUI
open and close parenthesis and we're going to set it to the teleport GUI like this so that is essentially it so now we're going to hit save we're going to hit public and I'm going to demonstrate what this looks like once we join into the game all right so I've joined into the game and in a little bit we should see that our new loading screen has showed up rather than roblox's default loading screen if you want to have a side-by-side comparison we were able to see our loading screen versus roblox's default one so that's
a simple way to add your own custom loading screen if you want to um make it look more nice for your game okay now there's something I want to add on to the guy that that you might think would be pretty helpful so what you saw with that transition it was only for like maybe uh a few seconds and then we were able to instantly be teleported into the game but what if we wanted to have a more smooth transition of like let's say uh a cut scene plays if um if the player teleports to
this other game or if you want uh to add more to the teleport GUI after they load into the game like let's say there's a loading bar that shows up and then it's going to show that there's a completion that happens uh and then it transitions you over to whatever you want to do within the second game that's just an example I'm going to throw out there but essentially what we're doing is basically taking the GUI that's been sent over and use it uh to and use it however we want uh as soon as they
load into the second game so what we're going to do is insert a local script inside of replicator first because this is the first thing we want to happen um once they teleport into the second game so we're going to hit the local script we're going to make reference to teleport service again so teleport service equals game col get service teleport service or teleport service like this and what we're going to do now is say teleport service colon get arriving teleport guy so this is what it looks like and we're actually going to make a
variable um before it so we're going to say local teleport gy equals teleport service get arriving teleport GUI and there's also another thing we need to make reference to and that's going to be replicated first so we're going to say say local replicated first equals game get service replicated first and let's first check to see if this teleport guy is existent because sometimes it might not be so we're going to say if teleport GUI then we're going to hit enter like this and so what we're going to do now is essentially take the teleport GUI
put it inside of uh the players's um player GUI and then for a specific amount of time we're just going to keep it there and then we're going to destroy so we're first going to make reference to the players's um player GUI and since this is local we can just say local player GUI equals game. players. local playerplayer guy like this and so another thing we need to do is remove the default loading screen as soon as we join into the game so we're going to say replicated first colon remove default loading screen like that
and what we're now going to do is basically set the teleport GUI parent to the player gu so we're going to say uh teleport gy. parent equal to player gy like that and now what we're going to do is put a task. we for maybe about 5 seconds and then finally we're going to destroy the teleport GUI like this and so what should happen now is when we join into the second place it's going to take the teleport GUI that was um given to us and we're going to put it inside of the player GUI
for five more seconds and and then we're going to destroy the teleport GUI after that so we're going to hit file publish to Roblox and now let's test the game all right so I'm loaded into the main game let's wait for the loading screen so the loading screen is here but it's waiting an additional 5 seconds before it ends up destroying the loading screen so that we can see it better and have it do anything else that we wanted to I'm not going to show you complicated examples of this feature but it's important to know
uh and be aware that this is something you can do with uh loading screen gys and all that sort of stuff so I hope this part has helped you all right the next thing I want to show you is teleport options now you might think what the heck is teleport options essentially what this is is that it gives us the ability to add more uh arguments to the teleport call that we have when we're sending players over from one place to the next and so this allows us to specify things like should the the player
be sent to a reserved server or what kind of data do we want to send over to the server that we are teleporting the player to and just general things like that it's an important thing to know about and so that's what I'm going to be showing you how to do uh right now so let's go back to our script and what we need to do first we need to create a Teleport options instance uh so that we can pass that into this teleport async uh function call that uh is going to give more arguments
to the teleport when we teleport the player to the next uh place so what we're going to do before the teleport ASN call we're going to drop two lines and at the top what we're going to do is say local teleport options equals instance. new open and close parentheses we're going to create teleport options like this and so now that we have teleport options we can add this as our third optional parameter here by putting in a comma and by specifying teleport options like this and so now uh what can we do with these teleport
options one thing that we can do is specify if this should be a reserve server so we can do is drop a line down here and say teleport options. should Reserve server like this and we're going to set this equal to true so what will essentially happen here is as soon as the player joins into the game then they will be teleported to a reserved server where if a new player decided to join into the game they cannot join the same server as this player because the player that because the server that this player is
in is in a reserved server so if I were to uh publish this game and test it then that is exactly what should happen so that is basically what goes on with Reserve servers and this is how you say to Roblox that we want you to create a reserve server for this player and things like that another thing we can do with teleport options is sending data between these different places so if you were to imagine that we're playing some sort of of matchmaking system uh inside of the main game that we want to send
data over to the other place so that we know like the correct setup the configurations and things like that like let's say we were playing a tower defense game uh we would be specifying the difficulty that we'd be playing uh we would be specifying how many waves there would be we'd be specifying the map and how many players there are and just things like that simple data like that that we transfer between one place to the next for basic configurations and other and those sorts of things then we can do that by send in data
through teleport options uh with the teleport async um method so here's what we're going to do we're going to create a table full of data that we're going to be sending over to the the other place so what we're going to do is say local teleport data equals open close hard brackets and we're going to hit enter like this so that we can specify for each entry there's going to be a specific data for each one so let's say we were playing a tower defense game then what we can do is say um I don't
know we can specify difficulty set that equal to let's say hard and then we can say how many lives I don't know like three I don't really know how Tire defense games go so we can say lives uh we can say the number of players we can set this equal to let's say two and just things like that like data like this we can send over with teleport async and now that we have our teleport data we need to specify uh the teleport data with teleport options so we're going to drop two lines and we're
going to say teleport options colon set teleport data open and close parenthesis and then we're going to pass in teleport data like this so now that we have this uh we're going to be sending over this data over to uh the other place but now we need to catch this data in our second place so that we can actually use it so I'm going to show you what that looks like in a so I'm going to show you what that looks like right now but what we need to do is go to our second place
now so I'm going to see you over there okay so I'm now in the second place and in order to catch this data we're going to create a script inside of server script service here and what we're going to do is create a player added event so we're going to say game. players. player added connect function open and close parentheses player pass that in like that now here's how we access the data so we need to First access what's called join data when the player joins into the game and it has all sorts of information
that we might find useful but specifically what we need is the teleport data so we're going to do is say local join data equals player colon get join data open close parentheses like this and now in order to specify the teleport data what we're going to do is drop a line and say local teleport data equals join data. teleport data like this so now from this we can basically access everything that we've created inside of teleport data so we can say uh local difficulty equals tele Port data. difficulty we can even say uh local num
or no just lives equals teleport data. lives and you kind of get the idea at this point so we can basically just print these out by saying uh difficulty uh concatenate this with difficulty and then we can also print um lives which is set equal to lives like this and so that is basically what's going to be printed out in the output once we test this out inside of the actual game so what I'm going to do again is go to file hit publish I'm also going to go to the main game go to file
and then hit publish and so now let's go into the actual game and test this for ourselves all right so I've joined into the game yet again so after we wait for some time then what's going to happen is it's going to teleport us to the next game and let's actually open up the developer console so that I can show you that it works in the output so I'm going to hit F9 go to server and as you can see in the output it printed out our difficulty being hard and Our Lives being three we
were successfully able to send data from the main game into this game so that we can now use this for whatever we want to use um for this place that we're now playing in okay now you might ask what kind of data should I send between these places versus if I were to use things like data stores to save data and then fetch them in this next place to that I say if you were to send data between uh servers or places I would just send basic configuration ations or settings kind of data that you'd
send over so let's say if we were you doing a matchmaking system in a horror game uh we'd specify the number of players that have joined into the game we'd specify uh the difficulty we'd specify the map and so we can basically configure this game to accommodate for uh what data we sent over and things like that because sending data over through teleport is more unsecure and it's easier to be exploited so for things that need more security and things that need persistence between or across all places within the game like things like leader stats
things like progression I would recommend using data stores and so I hope this part has cleared any confusion to you uh in order to decide what kind of data you want to send over through teleport service and I hope this part has helped you okay so now I want to explain the concept of place ID and job ID so there's a difference between these two and it's important to understand what makes them different so going back to our diagram that we had over here with the game and the multiple places we know what place ID
is because that's basically how we able to just go to one of these places and copy the ID to the clipboard so that we can specify which place we want to teleport the player to um and things like that job ID is a little different however if we were to let's say create a public server inside of one of these places Then This Server essentially has its own ID and this is what's called the job ID so the pl has a place ID but each individual server if I were to have multiple servers each individual
server has its own job ID and the reason it's important to know U when to use job ID is so that you can specify like let's say if a player joins into the main game then we want to have them teleport to a very specific server um contained within uh one of these places that are currently active and so if you know how to use job ID then you know how to send players to a very specific server that's running and that's what I'm going to be showing you how to do right now in this
uh section so going back to our script as a basic example what I'm going to do is add a a piece of information in the teleport data that's going to be this current games' uh job ID and so when we send that over to the second place we can see that there is a difference between job IDs so what we're going to do is drop a line down here in teleport data we're going to say job ID equals game . jobid and it's it's as simple as that and so once we have that taken care
of what we're also going to do is print what this actual job ID is inside of the main game's output so that we know that there is a difference so we're going to say print open close parentheses game. jobid like this and so once we have that taken care of let's go into place two all right so we're in place two we're going to drop a line down here and we're going to make the same print statement by saying game. jobid like this and now what we're going to do is is specify uh the job
ID property or the job ID data so we're going to say local job ID equals teleport data. jobid like that so now we're going to do is print um previous places job ID and then concatenate the job ID like this and so now essentially what's going to happen is we're going to start from the main game so the main game here is is going to specify its job ID of the main game and it's going to send that over to the second place the second place is going to print its own job ID and it's
also going to print the job ID from the previous place which is the main game so now what we're going to do is hit publish on both of these games and let's go and try this out all right so I'm loading into the main game and very quickly when we go to the server we can see this long string of text that was the job I did of the main game's server so now if we hit on server in the second game we can see at the top that this is our Uh current games' job
ID which is this ID here and as you can see uh it printed the exact same job ID from the previous game into this one so we can definitely see there's a difference between these two and if we can capture uh the job ID of a specific server that's how we know to send the player to a specific server and now I'm going to show you what this looks like through a practical example okay so here's what we're going to do I'm going to make it so that when uh let's say one of my friends
join into the server and they are inside of a different place in the same game I wanted so that if I hit follow on their profile like if I go to their profile and follow them into the game I want to be spawned into the same place that they're in not the same game because by default if you were to follow uh one of your friends into a Roblox game then they would be sent to the main game rather than the actual place that they're in and so in order for us to be able to
know which server and which place they're in specifically we're going to need to know their place ID and their job ID and so that's what I'm going to be showing you how to do inside of the script but it's mostly just going to be for um for testing and demonstration purposes so here's what we're going to do I'm going to go into the script and the first thing we're going to do is actually comment out the reserve server um check right here uh the Reserve server flag right here because this will not work if the
if your friend is inside of a reserved server you cannot join a reserved server and here's what we're going to do at the very top I'm going to specify if the player if the player's name is equal to uh a very specific player like my ALT account so I'm going to say Blasberg then that's going to be the name of my ALT account and then I'm going to place all of this from here inside of here now again this is just for testing purposes because because what would normally happen is if I was inside of
a game and I let's say was using a matchmaking system to have the player join a different game then we're going to specify through that rather than this check that's happening here but as of right now for this demonstration I'm going to do this uh alt account check and you can do this as well with your alt account if you want to try and uh play on multiple devices at the same time but this is essentially what I'm going to do so if let's say I'm playing on my alt account then it's going to teleport
me to this new place and if I'm not my ALT account like let's say I'm on my main bra braw battle account then I want to try and follow um my ALT account to the place that he's in specifically and there's a property for this that we can uh check to see whether this is the case or not and that's called follow user ID so this is what it's going to look like we're going to say local follow user ID equals player. follow user ID like that and we're first going to make a check by
saying if follow user ID and follow user ID does not equal to zero then because essentially follow user ID is the thing that's passed to us if we follow a player specifically through their profile and if it's not zero so it actually is legitimate then we're going to go down here and make that check for ourselves and continue with teleporting our player to the alt account so now what we need to do is fetch the information of the player that we're trying to follow with the place ID and also the job ID now we can
do this using a PE call because uh this has the potential to fail so that's why we need to be able to do that so what we're going to do is say local success error message and then there's going to be three other variables here I'm going to explain what these are just a little bit but we're going to say current uh instance Place ID and job ID we're going to set this equal to P call function function open close parentheses enter and then what we're going to do is say return teleport service colon get
player Place instance async open close parenthesis and then we're going to pass in the follow user ID so follow user ID now the reason it's structured like this is because get player Place instance async returns a tupal and if you remember what a tupal is it's not the same thing as a table it's basically multiple values paired together to have this be the return result uh as these three variables right here because as you know the first two variables success and error message that's going to be passed back with P call but get player instance
async is going to pass back three values that we need uh in order to uh know what place and what server this fallo user ID uh person is in I hope this part is making sense so far um if you need to recap on PE call you can watch my data source videos on that but I hope that this part is making sense to you so far so once we have the information of the place ID and the job ID that's when we can teleport um the player to the follow user ID's uh place and
um server so what we're going to do is say if success so if this was successful then we're going to say teleport service colon teleport to place instance so we're not using teleport async we're specifically using teleport two player instance we're going to put open close parentheses first thing we're going to do is specify the place ID second thing is specify the job ID and then finally we're going to specify the player we're teleporting now keep in mind for this instance we're just passing in one player and it's not a table of players so we
can just simply say player like that and if this was not successful then we're going to put a warning message for the error message uh like this for the error message just like that and this is essentially the script that we we're going to be using uh to have our alt account join into the second place and then have brawl battle like our main account follow uh my my ALT account into that specific place and so now I'm going to show you what this looks like in game so I'm going to hit file hit uh
publish to roblo make sure you always do that and now let me demonstrate this for you all right so here's what we have going on here so I'm on my ALT account right now Blasberg and I've currently been teleported to the second place in the game so now what I'm going to do is go into the Roblox homepage and go to my ALT account and I'm going to join his game directly so now what's going to happen is once I follow him into the game it's going to look for the follow ID and if it's
valid then it's going to teleport me to the specific place and server that my ALT account is in rather than just the lobby or the default Place itself so we're going to wait for that to load okay and as you can see as soon as I joined into the game I automatically got teleported to um the server and or the place and the server that my ALT account was in and so this is how we can specify how we can teleport uh specific players to specific servers now of course there's other ways you can do
it um but this is one way that I know is very practical to use inside of your Roblox game and so I wanted to demonstrate this example right here now again if things have confused you up until this point then I suggest you re-watching certain parts of the video that you think may have confuse you but this is a really good way to understand the difference between place and the place ID and job ID and how we can um bring and how we can bring players into specific servers because of that and I hope this
part has made sense to you so far okay and the last thing I want to show in this video is being able to handle failed teleports because the network can be bad for a lot of people depending on what device they play on and things like that teleports can definitely fail a lot of the time and we need to be able to make sure that if it fails once then we need the server to keep trying to uh teleport the player until it is successful and if we just have one call with teleport async it's
not exactly going to work so what we need to do is have a module that basically allows us to safely teleport the player and have it constantly retry uh to make sure that the players is being teleported uh safely and there is a really good module for this that's actually in the documentation I will have a link to this in the description of this video uh it's in the handling fail teleport section and basically what we're going to do is copy this script and have it in a module so that I can show you how
this works and I'm going to step through um what the script does and things like that so with the handled fail uh teleport section I'm going to hit copy uh this entire code and we're going to go back to the main game so what I'm going to do is go to replicated storage and I'm going to hit the plus sign and I'm going to insert a module script because this is essentially a module script that has a function that allows us to safely teleport the player to a game with the specified ID and everything like
that so I'm going to rename this to Safe teleport and then I'm going to select everything and I'm going to hit control B to paste uh the entire code like so and so now what we're going to do is go to our main script and what I'm going to do at the top here is require our module script so we're going to say local safe teleport equals game. replicated storage colon wait for Child open and close parentheses uh safe teleport and I'm also going to wrap this around in a requir call because we're trying to
get a module script just like this and so now what we can do instead of teleport async is that we can actually replace this with safe teleport like this so we can specify the place ID we can specify the uh amount of players inside of a table so we can just say player like this and then we can have our options with our teleport options like this so it's basically the exact same thing as up here with teleport async except we're using the safe teleport module instead of just having one teleport async called because this
will uh will serveice way better than if we were to just call teleport async once so now I want to go to the script and try and help you understand what is happening here with this entire script so if we at the very bottom obviously this is a module script and what this is returning is a function and what is this function this function is called safe teleport and basically What's Happening Here is that if we go down to the script we can see that uh we have an event called teleport and it failed so
this is within the event of a failed teleportation and if this does happen then what we're going to do is go and use this function which is handle fail teleport so there can be multitudes of reasons why why a Teleport has failed has the server been flooded was it just a simple failure then what we're going to do is have a little delay before we try and see if we can fix this and once we do do this then we're going to call this safe teleport function with the parameters that we've specified here up to
this main function right here with safe teleport and so basically What's Happening Here is we have an attempt index and then we have this Loop structure going on here so we have a PE call that's basically going to use the same function we were trying to use with teleport async but it's going to repeatedly do this over and over again so it's going to add the attempt index by one every single time it attempts to do this and if it was not successful then we're going to wait for a retry and then we're literally going
to go back up here again and we're going to try teleport async again to then uh have the attempt go up again and then it's going to keep on doing this over and over again until either it has been successful or if the attempt index has reached its limit by five like if it tried it five different times and so it's basically going to return the success and results of whether this was the case or not or it's going to throw in an error of whether this uh did not work or not and so that
is essentially the safe teleport module that we are going to be using instead of just simply using teleport async and I hope that this has made sense you up until this point conceptually like once again if there's something you didn't understand just rewatch this part and I hope that this will click to you one day and you'll realize that yeah like all these things do happen for a reason and so that is what I wanted to demonstrate to you as a final part to this episode now with everything that I've showed you up until this
point I want you to see if you can make this matchmaking system of basically having players step onto this pad and uh whenever it reaches a certain um threshold like let's say two players I want you to teleport all of these players within the pad to a specific server uh within a different place uh in the game and I also want you to send data that you might find useful to use uh in this other game that you're going to be um playing or you can try and apply this inside of your own game that
you're currently uh working on uh because this is a really good practice uh if you want to make a matchmaking system or just have different places within uh the same game so and if you need help with this you can join my Discord server you can ask uh anybody inside of the community to help you with this sort of thing uh because this entire uh learning process is a Community effort and also with the effort of what you put into to learn these things and I want to encourage more of that so that's basically going
to be it for this episode um this has been one of my favorite episodes in this uh Series so far because of how long it is and also how much information has been put inside of this video so whatever you can do to help this series by either liking this video commenting or sharing it with anybody else you know um that would be very very appreciative of you and I think that's basically going to be it for this episode if you're still confused confused about some of the concepts that I talked about in this video
um especially with things like replicated first with loading screens uh or things with um PE calls like the data stores video I'm actually going to send you a link to the data stores video which I'm going to have for you right here to watch so go ahead and watch that if you haven't already and I will see you in the next episode take care
Vídeos relacionados
Teams - Roblox Advanced Scripting #27 (2024)
26:08
Teams - Roblox Advanced Scripting #27 (2024)
BrawlDev
3,558 views
ROBLOX DAYCARE 2...
12:43
ROBLOX DAYCARE 2...
Flamingo
10,815,537 views
Could Link Win the Olympic Decathlon?
26:03
Could Link Win the Olympic Decathlon?
windowledge
200,783 views
I Added Schizophrenia to Roblox...
2:22
I Added Schizophrenia to Roblox...
ErExx
1,175 views
This creepy Alpha Minecraft channel only LIVESTREAMS
28:14
This creepy Alpha Minecraft channel only L...
Zachobuilds
674,157 views
DataStore (Saving Player Data, pcall(), Scopes) - Roblox Advanced Scripting #17 (2024)
46:59
DataStore (Saving Player Data, pcall(), Sc...
BrawlDev
24,572 views
Why Do Most Games Make Death Boring?
26:27
Why Do Most Games Make Death Boring?
ByteBlox
46,317 views
The Hardest ROBLOX Badge You've Never Heard Of
27:59
The Hardest ROBLOX Badge You've Never Hear...
Venshure
349,978 views
Making a difficult game about fitting in - Acerola Jam 0
19:17
Making a difficult game about fitting in -...
jess::codes
369,848 views
Sounds & Sound Groups - Roblox Advanced Scripting #9 (2023)
23:44
Sounds & Sound Groups - Roblox Advanced Sc...
BrawlDev
7,938 views
Exploits Are EASY to Fix, People Are Just Lazy
11:42
Exploits Are EASY to Fix, People Are Just ...
ByteBlox
277,691 views
I Spent 7 Days Trading Inside Roblox Jailbreak
43:17
I Spent 7 Days Trading Inside Roblox Jailb...
Yuukl
23,350 views
Tutorial on how to PROPERLY animate on ROBLOX Catalog Avatar Creator
8:41
Tutorial on how to PROPERLY animate on ROB...
SamWorks
110,359 views
This Is What 2 Years Of Scripting Looks Like
45:59
This Is What 2 Years Of Scripting Looks Like
Ludius
28,312 views
The Roblox Classic - A Disappointing Improvement
8:06
The Roblox Classic - A Disappointing Impro...
greenlegocats123
126,755 views
I Made a Fake Warning to Scare Roblox Players
16:31
I Made a Fake Warning to Scare Roblox Players
ByteBlox
1,241,957 views
Can 2 DEVS Make A SURVIVAL Game in 24 Hours? (Roblox)
12:03
Can 2 DEVS Make A SURVIVAL Game in 24 Hour...
Reakol
24,302 views
Can 14 Random ROBLOX Developers Make a Game in 7 DAYS?
15:56
Can 14 Random ROBLOX Developers Make a Gam...
BrawlDev
132,330 views
Animations (Rigs, Editor, Tracks) - Roblox Advanced Scripting #20 (2024)
31:04
Animations (Rigs, Editor, Tracks) - Roblox...
BrawlDev
7,271 views