YouTube2Text

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

by BrawlDev · 9,067 words · 1,194 segments · language en · Watch on YouTube

Full transcript

  1. 0:00damn I can't even play this game until I
  2. 0:02have another person inside of this pad
  3. 0:04for this matchmaking system oh my God
  4. 0:07what am I going to do about this oh wait
  5. 0:09wait I see a player hey you bro over
  6. 0:11there huh yeah I'm talking to you bro
  7. 0:13come over here I need another person so
  8. 0:15that we can actually play this game all
  9. 0:17right we got two out of two players so
  10. 0:18now let's see oh all right we're going
  11. 0:20into the next game oo let's see what
  12. 0:23this game is about to be
  13. 0:25like
  14. 0:26uh what am I in hell right now
  15. 0:30bro this is kind of weird is this what
  16. 0:33Roblox games be like nowadays oh my
  17. 0:36goodness this is um this is quite an
  18. 0:38interesting place both of us landed into
  19. 0:40all right but what you just saw was a
  20. 0:42teleportation from the main game that we
  21. 0:44were just playing on to this other
  22. 0:46alternative game that's really strange
  23. 0:49but uh that is essentially what happened
  24. 0:51we got into a Teleport matchmaking
  25. 0:53system and then we got teleported to
  26. 0:54another place within the same exact game
  27. 0:57and this is using a feature called
  28. 0:59teleport service that essentially allows
  29. 1:01us to teleport players between places
  30. 1:05within the same game and do other cool
  31. 1:07neat features with it like sending data
  32. 1:09over uh to other servers and joining
  33. 1:11specific players into specific servers
  34. 1:13and things like that so in this video
  35. 1:15I'm going to be showing you how teleport
  36. 1:17service works and how you can implement
  37. 1:18it inside of Roblox Studio but let me
  38. 1:21try and explain more of teleport service
  39. 1:24before we get into implementing so let's
  40. 1:26go straight into that all right let's
  41. 1:28think about this for a minute I'm going
  42. 1:29to try and explain the concept of
  43. 1:31teleport service so that we can get a
  44. 1:33better idea of how this works and why
  45. 1:35it's important for us to know uh how to
  46. 1:38use this inside of Roblox studio so with
  47. 1:40the example that I showed you in the
  48. 1:41beginning of this video we had a
  49. 1:43matchmaking system over there and once
  50. 1:45we had enough players we were teleported
  51. 1:48to a different place within the same
  52. 1:50game that had its own contents that was
  53. 1:53not available inside of this main game
  54. 1:55right here um and this is using uh the
  55. 1:58ability that we have as developers to
  56. 2:01teleport players into a different place
  57. 2:03within the same game and so the way I
  58. 2:05want you to think about this is if I
  59. 2:07were to open up Explorer we have
  60. 2:09everything inside of here that comprises
  61. 2:11of a game with its own properties and
  62. 2:14things like that so what you're seeing
  63. 2:15right now is the main game but if we
  64. 2:17were to teleport to a different place
  65. 2:20then this uh game would basically be
  66. 2:22reset back to its defaults and we can
  67. 2:25add whatever we want um inside of this
  68. 2:28game that's going to be different from
  69. 2:30this main game and so that's how I want
  70. 2:33you to think about this in terms of
  71. 2:34different places within the same game
  72. 2:37and so now I want to show you what this
  73. 2:38looks like conceptually so what we have
  74. 2:42going on here is the game itself and
  75. 2:45this game can be comprised of multiple
  76. 2:48different places attached to the same
  77. 2:50game so uh as we've been following along
  78. 2:53through this Advanced scripting tutorial
  79. 2:54guide we've basically just been having
  80. 2:56one place be connected to the game and
  81. 2:59so so with the ability of teleport
  82. 3:01service we can create as many places as
  83. 3:04we want attached to the game itself so
  84. 3:08what I want you to understand is there
  85. 3:10can only be one game but there can be
  86. 3:13multiple games attached to the same game
  87. 3:15if we want to teleport players between
  88. 3:18each of these places and so now I want
  89. 3:20you to understand how creating servers
  90. 3:22work inside of this structure so how how
  91. 3:26do servers work when players join into
  92. 3:29the game we need to be able to create a
  93. 3:31server for them to be able to join into
  94. 3:32this game as you probably know so what
  95. 3:35Roblox decides to do is create a public
  96. 3:38server uh that's open to anybody who
  97. 3:40joins into the game to then be thrown
  98. 3:42into this public server as long as
  99. 3:45there's enough players that um don't
  100. 3:47reach Max Capacity or whatever so uh the
  101. 3:50players once they join to the game they
  102. 3:52join into the main place now if let's
  103. 3:54say we wanted to have the players join
  104. 3:56into another place like if we were to
  105. 3:58teleport them to the second place we
  106. 4:00need Roblox to create another public
  107. 4:02server so that these players can be
  108. 4:05teleported over to This Server inside of
  109. 4:08the second place so we're going to use
  110. 4:09teleport service to essentially move the
  111. 4:12players from this game or from this
  112. 4:14place into this place over here and if
  113. 4:17let's say we teleported everybody then
  114. 4:19we then this is just going to be an
  115. 4:20empty server and Roblox can just remove
  116. 4:23this public server because we don't need
  117. 4:24it anymore and so this is essentially
  118. 4:27how server hopping or server
  119. 4:28teleportation works inside of Roblox
  120. 4:31Studio within different places and we
  121. 4:33can basically just do the same thing
  122. 4:34with Place three as well if we created a
  123. 4:36public server then we can uh send the
  124. 4:38players over to this place and you kind
  125. 4:40of get the idea at this point so that is
  126. 4:43how server teleportation works but what
  127. 4:45makes this interesting is that we can
  128. 4:47have different server types for players
  129. 4:50to teleport into this game so uh another
  130. 4:54type of server that's interesting to
  131. 4:55know about is reserved servers and with
  132. 4:59the name reserved servers basically what
  133. 5:01this is is if we let's say had players
  134. 5:04uh back from the main place like this uh
  135. 5:07if we wanted to teleport them to an
  136. 5:10exclusive server inside of this place so
  137. 5:12that if future players came into the
  138. 5:15main game and wanted to teleport to this
  139. 5:17place then they would not be able to be
  140. 5:19uh joining inside of this Reserve server
  141. 5:22because this is only exclusive to the
  142. 5:24players that were sent over to this
  143. 5:26place uh from the beginning so if we
  144. 5:28sent the players over to this reserved
  145. 5:30server then no players up until this
  146. 5:33point like if let's say we had more
  147. 5:35players here they cannot Join This
  148. 5:37Server because this is a reserved server
  149. 5:39they can only go to the public server um
  150. 5:42that is created for them inside of place
  151. 5:44two or if we created a new Reserve
  152. 5:47server for these players to play inside
  153. 5:49of the game I hope this is making sense
  154. 5:50to you uh this is basically the idea of
  155. 5:54how teleportation Works inside of a game
  156. 5:56within different places um there can
  157. 5:58also be other things things like sending
  158. 6:00data over between different places but
  159. 6:03I'm going to go more into detail of what
  160. 6:05this entails later on inside of the
  161. 6:06video and that is essentially the basic
  162. 6:08structure of this now with teleport
  163. 6:10service you can even teleport to uh
  164. 6:13thirdparty games that are not included
  165. 6:15within your game itself like let's say
  166. 6:18we had another game here with adopt me
  167. 6:20or another game with pet Simulator X
  168. 6:22then we can send the player from our
  169. 6:24game to that uh like alternative third
  170. 6:28party game as well with teleport servers
  171. 6:29but for the sake of this tutorial I'm
  172. 6:31going to resort to just teleporting
  173. 6:34between different places within the same
  174. 6:36game that we own so I hope this has made
  175. 6:38sense to you and with that being said
  176. 6:40let's go ahead and get straight into
  177. 6:42implementing teleport service inside of
  178. 6:44Roblox studio now that we understand it
  179. 6:47let's Implement teleport service inside
  180. 6:49of Roblox studio now as I explained
  181. 6:51earlier we need to be able to have
  182. 6:53multiple places within the game so that
  183. 6:55we can teleport these players between
  184. 6:57these places because by default when you
  185. 7:00create a a game on Roblox um there's
  186. 7:03only one place attached to it which is
  187. 7:05just this main game right here but now
  188. 7:07we have the ability to create multiple
  189. 7:09places that connect to the exact same
  190. 7:11game and the way we do that is by going
  191. 7:14up to view and we're going to be
  192. 7:16clicking on asset manager over here and
  193. 7:18there's going to be a bunch of these
  194. 7:20folders here that we can create as
  195. 7:22assets to be used inside of our game and
  196. 7:24the first one on the list is places so
  197. 7:26we're going to double click on this and
  198. 7:28there should be a a list of all the
  199. 7:30games or all the places that we have
  200. 7:32contained within this game so what we're
  201. 7:34going to do is create a place within
  202. 7:37this game right here so we're going to
  203. 7:39Simply right click on this and we're
  204. 7:40going to hit add new place like this and
  205. 7:43so Roblox is going to generate a new
  206. 7:45place for us that's now attached to this
  207. 7:47game that we're playing so if we double
  208. 7:49click on it then what should happen is
  209. 7:51Roblox studio is going to open up a new
  210. 7:54window that's going to be reserved
  211. 7:57exclusively uh or not exclusively but
  212. 7:59specifically for this game that we are
  213. 8:02creating so I'm just going to let Roblox
  214. 8:04Studio load this up really quick uh so
  215. 8:06that we can be connected into this new
  216. 8:09game and so now as you can see once we
  217. 8:12are loaded in we have a fresh base plate
  218. 8:15to work with and if we go to places we
  219. 8:18can still see that these places are
  220. 8:19connected with each other just ignore
  221. 8:21this one test place one for now just
  222. 8:22pretend that there's two places here so
  223. 8:24one for the main game and one for the
  224. 8:26place that we just created so this name
  225. 8:28for this place is kind of weird so so
  226. 8:29what I'm going to do is right click on
  227. 8:30it and hit rename so we're going to call
  228. 8:33this place two just to keep it simple uh
  229. 8:36so now we have place two and the the
  230. 8:39main game so we can actually just rename
  231. 8:41this to main game just to make it
  232. 8:43simpler so we have the main game and
  233. 8:45place two so that should be uh what we
  234. 8:48are working with as of right now okay
  235. 8:50and that's pretty much all it takes to
  236. 8:51create the second place uh within the
  237. 8:53same game so now what we're going to do
  238. 8:55is teleport the player to this place
  239. 8:58through script all right so I'm back
  240. 9:00into the main game and here's what we're
  241. 9:01going to do we're going to go on the
  242. 9:03right side of server script service
  243. 9:04we're going to hit the plus sign and
  244. 9:05we're going to insert a script so the
  245. 9:08first thing we're going to do is make
  246. 9:09reference to the service that we're
  247. 9:10going to be using which is of course
  248. 9:12teleport service so we're going to say
  249. 9:13local teleport service equals game colon
  250. 9:18get service open and close parentheses
  251. 9:21teleport service like this now there's
  252. 9:24two pieces of information that we need
  253. 9:26in order to teleport the player into um
  254. 9:29this this place so the first one is
  255. 9:31specifying exactly which place that we
  256. 9:34want to teleport the players to given
  257. 9:36their place ID so what we're going to do
  258. 9:38is go to our asset manager for place two
  259. 9:40we're going to right click on it and
  260. 9:42we're going to hit copy ID to clipboard
  261. 9:44so we're going to click that and then
  262. 9:45we're going to create a variable so that
  263. 9:47we know that this is the ID that we need
  264. 9:49so we're going to say local place ID
  265. 9:52equals and then we're just going to
  266. 9:54paste um the ID like this and so now
  267. 9:57that we have the place ID we need to
  268. 10:00specify the player that's going to be
  269. 10:02teleported or players in this case and
  270. 10:04an easy way we can do this is by making
  271. 10:07a player added event so that as soon as
  272. 10:09the player joins into the main game
  273. 10:11they're going to be teleported to the
  274. 10:12second place right away so what we're
  275. 10:15going to do is drop two lines and say
  276. 10:17game. players. player added colon
  277. 10:21connect function open close parentheses
  278. 10:23we're going to pass in the player
  279. 10:25argument and we're going to hit enter so
  280. 10:27what we're going to do is now say
  281. 10:29teleport service colon teleport async
  282. 10:34open and close parentheses and we're
  283. 10:36going to pass in the place ID and we're
  284. 10:38also going to pass in the players that
  285. 10:40are going to be teleported so in this
  286. 10:41case we're going to say player now there
  287. 10:44is something you have to be careful
  288. 10:45about this this is the first thing
  289. 10:47people get tripped up about and that is
  290. 10:50this takes in a table of players not
  291. 10:53just one player we're not just passing
  292. 10:55in one instance of the player to be
  293. 10:57teleported we need to pass in a table
  294. 10:59and so what we need to do is wrap this
  295. 11:02player in curly brackets to indicate
  296. 11:04that this is a table with one L that
  297. 11:07this is a table with one player inside
  298. 11:09of it and so this is a common thing
  299. 11:11people get tripped up about and you and
  300. 11:13you need to make sure that you have this
  301. 11:14taken care of okay great so this is
  302. 11:16basically our script right here but in
  303. 11:18order for us to test this script
  304. 11:19unfortunately we can't do this inside of
  305. 11:21Roblox Studio we're going to have to
  306. 11:23publish this game to Roblox so that we
  307. 11:26can play it in the game so that we can
  308. 11:28be teleported to this next place so what
  309. 11:30we're going to do is go on the top left
  310. 11:32hit file and we're going to hit publish
  311. 11:33to Roblox and if this is your first time
  312. 11:35publishing it just make sure that you
  313. 11:37create a new game um and have it be
  314. 11:41published to Roblox basically so another
  315. 11:44thing we need to make sure is to go to
  316. 11:46our second game like our second place
  317. 11:48and also publish that as well so we need
  318. 11:50to make sure that that is taken care of
  319. 11:51as well all right so we're in the second
  320. 11:53place hit file hit publish to Roblox and
  321. 11:56that is essentially taken care of now so
  322. 11:57what we can do now is go into the the
  323. 11:59actual game and test this for ourselves
  324. 12:01all right so this is what my published
  325. 12:03game looks like so I'm just going to hit
  326. 12:04play and then once we join into the
  327. 12:07place it's going to teleport us as soon
  328. 12:09as we join into the main game all right
  329. 12:11so I've now loaded into the main game
  330. 12:13after waiting for a bit as you can see
  331. 12:15the game has now teleported us to the
  332. 12:18second place that we specified um as
  333. 12:20soon as we joined into the main game
  334. 12:22we've now been teleported to the second
  335. 12:23place so it's basically working as
  336. 12:25expected this is the basics of using
  337. 12:27teleport service to teleport players
  338. 12:29from one place to the next so now that
  339. 12:32we know that teleporting Works another
  340. 12:34thing we can do is create our own
  341. 12:36loading screen or transition screen from
  342. 12:39one place to the next so uh we saw that
  343. 12:41when we teleported Roblox used their own
  344. 12:44default loading screen but we can
  345. 12:45replace that with our own loading screen
  346. 12:47if we wanted to and here's how it's
  347. 12:49going to work so we're first going to
  348. 12:51create it in starter GUI so we're just
  349. 12:52going to hit the plus sign and we're
  350. 12:53going to insert a screen GUI we're going
  351. 12:55to call this teleport GUI and and we're
  352. 13:00also going to check ignore GUI inset so
  353. 13:02we're going to check this off and what
  354. 13:04we're going to do is hit the plus sign
  355. 13:06create a frame we're going to surround
  356. 13:08the entire screen with this Frame so
  357. 13:10we're going to set the size of this to 1
  358. 13:13comma 0 comma 1 comma 0 like this and
  359. 13:15we're also going to change the
  360. 13:17background color to something dark
  361. 13:19probably like around here and we're also
  362. 13:22going to insert a text label inside of
  363. 13:23this Frame and we're going to move this
  364. 13:26text label uh down here and we're also
  365. 13:29Al going to drag this out just a little
  366. 13:31bit so that we can see it nice and big
  367. 13:33and we're also going to align this
  368. 13:35probably like somewhere down here so we
  369. 13:38need to make sure that the size is also
  370. 13:40using scale instead of offset so we're
  371. 13:42going to uh change these properties to
  372. 13:45zero and we're going to make the scales
  373. 13:48probably like let's say um
  374. 13:520.2 and we're going to make this one 0.4
  375. 13:55for the Y um or not we could just scale
  376. 13:58it like this now that we know that we're
  377. 14:00in the scale off that we're in the scale
  378. 14:02not the offset okay so now that we have
  379. 14:04that taken care of let's go down here
  380. 14:06let's uh scale the text like this let's
  381. 14:09change the text color to white and we're
  382. 14:12going to change the text to loading dot
  383. 14:15dot dot just like this and let's go back
  384. 14:18up and change the background color of
  385. 14:19this to something even darker than the
  386. 14:23the frames color so it's going to look
  387. 14:25like this and now we have a basic
  388. 14:27teleport um loading screen G thing not
  389. 14:30the best thing but it's something to
  390. 14:31work with so now that we have this we
  391. 14:34need a place to put this teleport GUI uh
  392. 14:36for for us to be able to access to be
  393. 14:39able to set this GUI so we're going to
  394. 14:41move teleport GUI into replicated
  395. 14:44storage now the thing about this is we
  396. 14:47have our teleport GUI but we need to be
  397. 14:49able to set our teleport GUI to this GUI
  398. 14:52in particular and the way we're going to
  399. 14:53do that is by creating a local script
  400. 14:56and having teleport servers set this GUI
  401. 14:58as the loading screen so this can only
  402. 15:01be done on the client as well so we need
  403. 15:04a place to put this local script so that
  404. 15:06we can access this teleport GUI so we're
  405. 15:08going to open up starter player and
  406. 15:10we're going to make a local script
  407. 15:12inside of starter player scripts so
  408. 15:14we're going to search up local script
  409. 15:15insert this and we're going to go back
  410. 15:18to our original script copy this
  411. 15:20reference to teleport service and we're
  412. 15:22going to insert it into here so now what
  413. 15:25we're going to do is also make reference
  414. 15:26to the teleport GUI so we're going to
  415. 15:28say local teleport guy equals game.
  416. 15:31replicated storage wait for Child open
  417. 15:34and close parenthesis teleport guy like
  418. 15:36this and so all it takes is just one
  419. 15:40simple method and it's simply just
  420. 15:43teleport service colon set teleport GUI
  421. 15:49open and close parenthesis and we're
  422. 15:50going to set it to the teleport GUI like
  423. 15:53this so that is essentially it so now
  424. 15:56we're going to hit save we're going to
  425. 15:58hit public and I'm going to demonstrate
  426. 16:00what this looks like once we join into
  427. 16:01the game all right so I've joined into
  428. 16:03the game and in a little bit we should
  429. 16:05see that our new loading screen has
  430. 16:07showed up rather than roblox's default
  431. 16:09loading screen if you want to have a
  432. 16:10side-by-side comparison we were able to
  433. 16:12see our loading screen versus roblox's
  434. 16:15default one so that's a simple way to
  435. 16:17add your own custom loading screen if
  436. 16:19you want to um make it look more nice
  437. 16:21for your game okay now there's something
  438. 16:23I want to add on to the guy that that
  439. 16:26you might think would be pretty helpful
  440. 16:28so what you saw with that transition it
  441. 16:30was only for like maybe uh a few seconds
  442. 16:33and then we were able to instantly be
  443. 16:34teleported into the game but what if we
  444. 16:36wanted to have a more smooth transition
  445. 16:38of like let's say uh a cut scene plays
  446. 16:41if um if the player teleports to this
  447. 16:43other game or if you want uh to add more
  448. 16:46to the teleport GUI after they load into
  449. 16:48the game like let's say there's a
  450. 16:50loading bar that shows up and then it's
  451. 16:51going to show that there's a completion
  452. 16:53that happens uh and then it transitions
  453. 16:55you over to whatever you want to do
  454. 16:56within the second game that's just an
  455. 16:58example I'm going to throw out there but
  456. 16:59essentially what we're doing is
  457. 17:01basically taking the GUI that's been
  458. 17:04sent over and use it uh to and use it
  459. 17:07however we want uh as soon as they load
  460. 17:09into the second game so what we're going
  461. 17:11to do is insert a local script inside of
  462. 17:14replicator first because this is the
  463. 17:15first thing we want to happen um once
  464. 17:18they teleport into the second game so
  465. 17:20we're going to hit the local script
  466. 17:23we're going to make reference to
  467. 17:24teleport service again so teleport
  468. 17:27service equals game col get service
  469. 17:30teleport service or teleport service
  470. 17:32like this and what we're going to do now
  471. 17:34is say teleport service colon get
  472. 17:40arriving teleport guy so this is what it
  473. 17:44looks like and we're actually going to
  474. 17:45make a variable um before it so we're
  475. 17:48going to say local teleport gy equals
  476. 17:51teleport service get arriving teleport
  477. 17:53GUI and there's also another thing we
  478. 17:55need to make reference to and that's
  479. 17:56going to be replicated first so we're
  480. 17:58going to say say local replicated first
  481. 18:01equals game get service replicated first
  482. 18:06and let's first check to see if this
  483. 18:08teleport guy is existent because
  484. 18:10sometimes it might not be so we're going
  485. 18:12to say if teleport GUI then we're going
  486. 18:16to hit enter like this and so what we're
  487. 18:17going to do now is essentially take the
  488. 18:20teleport GUI put it inside of uh the
  489. 18:23players's um player GUI and then for a
  490. 18:26specific amount of time we're just going
  491. 18:27to keep it there and then we're going to
  492. 18:28destroy so we're first going to make
  493. 18:30reference to the players's um player GUI
  494. 18:33and since this is local we can just say
  495. 18:35local player GUI equals game. players.
  496. 18:41local
  497. 18:43playerplayer guy like this and so
  498. 18:46another thing we need to do is remove
  499. 18:48the default loading screen as soon as we
  500. 18:50join into the game so we're going to say
  501. 18:52replicated first colon remove default
  502. 18:56loading screen like that and what we're
  503. 19:00now going to do is basically set the
  504. 19:03teleport GUI parent to the player gu so
  505. 19:05we're going to say uh teleport gy.
  506. 19:08parent equal to player gy like that and
  507. 19:14now what we're going to do is put a
  508. 19:16task. we for maybe about 5 seconds and
  509. 19:18then finally we're going to destroy the
  510. 19:21teleport GUI like this and so what
  511. 19:24should happen now is when we join into
  512. 19:25the second place it's going to take the
  513. 19:28teleport GUI that was um given to us and
  514. 19:31we're going to put it inside of the
  515. 19:33player GUI for five more seconds and and
  516. 19:35then we're going to destroy the teleport
  517. 19:37GUI after that so we're going to hit
  518. 19:39file publish to Roblox and now let's
  519. 19:42test the game all right so I'm loaded
  520. 19:43into the main game let's wait for the
  521. 19:44loading screen so the loading screen is
  522. 19:46here but it's waiting an additional 5
  523. 19:49seconds before it ends up destroying the
  524. 19:51loading screen so that we can see it
  525. 19:53better and have it do anything else that
  526. 19:55we wanted to I'm not going to show you
  527. 19:56complicated examples of this feature but
  528. 19:59it's important to know uh and be aware
  529. 20:01that this is something you can do with
  530. 20:04uh loading screen gys and all that sort
  531. 20:06of stuff so I hope this part has helped
  532. 20:07you all right the next thing I want to
  533. 20:09show you is teleport options now you
  534. 20:11might think what the heck is teleport
  535. 20:13options essentially what this is is that
  536. 20:15it gives us the ability to add more uh
  537. 20:19arguments to the teleport call that we
  538. 20:21have when we're sending players over
  539. 20:23from one place to the next and so this
  540. 20:25allows us to specify things like should
  541. 20:28the the player be sent to a reserved
  542. 20:30server or what kind of data do we want
  543. 20:33to send over to the server that we are
  544. 20:35teleporting the player to and just
  545. 20:37general things like that it's an
  546. 20:38important thing to know about and so
  547. 20:39that's what I'm going to be showing you
  548. 20:40how to do uh right now so let's go back
  549. 20:43to our script and what we need to do
  550. 20:46first we need to create a Teleport
  551. 20:48options instance uh so that we can pass
  552. 20:51that into this teleport async uh
  553. 20:53function call that uh is going to give
  554. 20:56more arguments to the teleport when we
  555. 20:59teleport the player to the next uh place
  556. 21:01so what we're going to do before the
  557. 21:03teleport ASN call we're going to drop
  558. 21:05two lines and at the top what we're
  559. 21:07going to do is say local teleport
  560. 21:10options equals instance. new open and
  561. 21:13close parentheses we're going to create
  562. 21:15teleport options like this and so now
  563. 21:18that we have teleport options we can add
  564. 21:20this as our third optional parameter
  565. 21:23here by putting in a comma and by
  566. 21:25specifying teleport options like this
  567. 21:29and so now uh what can we do with these
  568. 21:32teleport options one thing that we can
  569. 21:33do is specify if this should be a
  570. 21:35reserve server so we can do is drop a
  571. 21:37line down here and say teleport
  572. 21:40options. should Reserve server like this
  573. 21:45and we're going to set this equal to
  574. 21:46true so what will essentially happen
  575. 21:49here is as soon as the player joins into
  576. 21:51the game then they will be teleported to
  577. 21:53a reserved server where if a new player
  578. 21:56decided to join into the game they
  579. 21:57cannot join the same server as this
  580. 21:59player because the player that because
  581. 22:02the server that this player is in is in
  582. 22:04a reserved server so if I were to uh
  583. 22:07publish this game and test it then that
  584. 22:09is exactly what should happen so that is
  585. 22:12basically what goes on with Reserve
  586. 22:14servers and this is how you say to
  587. 22:16Roblox that we want you to create a
  588. 22:17reserve server for this player and
  589. 22:19things like that another thing we can do
  590. 22:21with teleport options is sending data
  591. 22:24between these different places so if you
  592. 22:26were to imagine that we're playing some
  593. 22:28sort of of matchmaking system uh inside
  594. 22:30of the main game that we want to send
  595. 22:32data over to the other place so that we
  596. 22:34know like the correct setup the
  597. 22:36configurations and things like that like
  598. 22:38let's say we were playing a tower
  599. 22:39defense game uh we would be specifying
  600. 22:41the difficulty that we'd be playing uh
  601. 22:43we would be specifying how many waves
  602. 22:44there would be we'd be specifying the
  603. 22:46map and how many players there are and
  604. 22:48just things like that simple data like
  605. 22:50that that we transfer between one place
  606. 22:52to the next for basic configurations and
  607. 22:55other and those sorts of things then we
  608. 22:57can do that by send in data through
  609. 22:59teleport options uh with the teleport
  610. 23:01async um method so here's what we're
  611. 23:04going to do we're going to create a
  612. 23:05table full of data that we're going to
  613. 23:07be sending over to the the other place
  614. 23:10so what we're going to do is say local
  615. 23:13teleport data equals open close hard
  616. 23:16brackets and we're going to hit enter
  617. 23:17like this so that we can specify for
  618. 23:19each entry there's going to be a
  619. 23:21specific data for each one so let's say
  620. 23:23we were playing a tower defense game
  621. 23:25then what we can do is say um I don't
  622. 23:27know we can specify
  623. 23:29difficulty set that equal to let's say
  624. 23:32hard and then we can say how many lives
  625. 23:34I don't know like three I don't really
  626. 23:35know how Tire defense games go so we can
  627. 23:37say lives uh we can say the number of
  628. 23:41players we can set this equal to let's
  629. 23:44say two and just things like that like
  630. 23:46data like this we can send over with
  631. 23:48teleport async and now that we have our
  632. 23:50teleport data we need to specify uh the
  633. 23:54teleport data with teleport options so
  634. 23:56we're going to drop two lines and we're
  635. 23:57going to say teleport options colon set
  636. 24:02teleport data open and close parenthesis
  637. 24:05and then we're going to pass in teleport
  638. 24:07data like this so now that we have this
  639. 24:10uh we're going to be sending over this
  640. 24:11data over to uh the other place but now
  641. 24:14we need to catch this data in our second
  642. 24:16place so that we can actually use it so
  643. 24:18I'm going to show you what that looks
  644. 24:19like in a so I'm going to show you what
  645. 24:20that looks like right now but what we
  646. 24:22need to do is go to our second place now
  647. 24:24so I'm going to see you over there okay
  648. 24:26so I'm now in the second place and in
  649. 24:27order to catch this data we're going to
  650. 24:30create a script inside of server script
  651. 24:31service here and what we're going to do
  652. 24:34is create a player added event so we're
  653. 24:36going to say game. players. player added
  654. 24:39connect function open and close
  655. 24:41parentheses player pass that in like
  656. 24:43that now here's how we access the data
  657. 24:46so we need to First access what's called
  658. 24:49join data when the player joins into the
  659. 24:51game and it has all sorts of information
  660. 24:53that we might find useful but
  661. 24:55specifically what we need is the
  662. 24:57teleport data so we're going to do is
  663. 24:58say local join data equals player colon
  664. 25:03get join data open close parentheses
  665. 25:06like this and now in order to specify
  666. 25:09the teleport data what we're going to do
  667. 25:10is drop a line and say local teleport
  668. 25:13data equals join data. teleport data
  669. 25:18like this so now from this we can
  670. 25:20basically access everything that we've
  671. 25:22created inside of teleport data so we
  672. 25:24can say uh local difficulty equals tele
  673. 25:28Port data. difficulty we can even say uh
  674. 25:32local num or no just lives equals
  675. 25:36teleport data. lives and you kind of get
  676. 25:38the idea at this point so we can
  677. 25:40basically just print these out by saying
  678. 25:42uh difficulty uh concatenate this with
  679. 25:46difficulty and then we can also print um
  680. 25:49lives which is set equal to lives like
  681. 25:53this and so that is basically what's
  682. 25:55going to be printed out in the output
  683. 25:56once we test this out inside of the
  684. 25:59actual game so what I'm going to do
  685. 26:00again is go to file hit publish I'm also
  686. 26:03going to go to the main game go to file
  687. 26:05and then hit publish and so now let's go
  688. 26:07into the actual game and test this for
  689. 26:08ourselves all right so I've joined into
  690. 26:10the game yet again so after we wait for
  691. 26:12some time then what's going to happen is
  692. 26:14it's going to teleport us to the next
  693. 26:16game and let's actually open up the
  694. 26:18developer console so that I can show you
  695. 26:20that it works in the output so I'm going
  696. 26:21to hit F9 go to server and as you can
  697. 26:25see in the output it printed out our
  698. 26:27difficulty being hard and Our Lives
  699. 26:28being three we were successfully able to
  700. 26:31send data from the main game into this
  701. 26:33game so that we can now use this for
  702. 26:35whatever we want to use um for this
  703. 26:38place that we're now playing in okay now
  704. 26:40you might ask what kind of data should I
  705. 26:43send between these places versus if I
  706. 26:45were to use things like data stores to
  707. 26:48save data and then fetch them in this
  708. 26:49next place to that I say if you were to
  709. 26:52send data between uh servers or places I
  710. 26:56would just send basic configuration
  711. 26:58ations or settings kind of data that
  712. 27:00you'd send over so let's say if we were
  713. 27:03you doing a matchmaking system in a
  714. 27:04horror game uh we'd specify the number
  715. 27:06of players that have joined into the
  716. 27:08game we'd specify uh the difficulty we'd
  717. 27:10specify the map and so we can basically
  718. 27:13configure this game to accommodate for
  719. 27:16uh what data we sent over and things
  720. 27:17like that because sending data over
  721. 27:20through teleport is more unsecure and
  722. 27:23it's easier to be exploited so for
  723. 27:25things that need more security and
  724. 27:28things that need persistence between or
  725. 27:30across all places within the game like
  726. 27:33things like leader stats things like
  727. 27:34progression I would recommend using data
  728. 27:37stores and so I hope this part has
  729. 27:39cleared any confusion to you uh in order
  730. 27:41to decide what kind of data you want to
  731. 27:43send over through teleport service and I
  732. 27:45hope this part has helped you okay so
  733. 27:47now I want to explain the concept of
  734. 27:50place ID and job ID so there's a
  735. 27:53difference between these two and it's
  736. 27:54important to understand what makes them
  737. 27:56different so going back to our diagram
  738. 27:58that we had over here with the game and
  739. 28:00the multiple places we know what place
  740. 28:02ID is because that's basically how we
  741. 28:04able to just go to one of these places
  742. 28:07and copy the ID to the clipboard so that
  743. 28:08we can specify which place we want to
  744. 28:11teleport the player to um and things
  745. 28:14like that job ID is a little different
  746. 28:16however if we were to let's say create a
  747. 28:18public server inside of one of these
  748. 28:20places Then This Server essentially has
  749. 28:23its own ID and this is what's called the
  750. 28:26job ID so the pl
  751. 28:28has a place ID but each individual
  752. 28:31server if I were to have multiple
  753. 28:32servers each individual server has its
  754. 28:35own job ID and the reason it's important
  755. 28:38to know U when to use job ID is so that
  756. 28:41you can specify like let's say if a
  757. 28:43player joins into the main game then we
  758. 28:45want to have them teleport to a very
  759. 28:47specific server um contained within uh
  760. 28:51one of these places that are currently
  761. 28:53active and so if you know how to use job
  762. 28:55ID then you know how to send players to
  763. 28:58a very specific server that's running
  764. 29:01and that's what I'm going to be showing
  765. 29:02you how to do right now in this uh
  766. 29:04section so going back to our script as a
  767. 29:06basic example what I'm going to do is
  768. 29:09add a a piece of information in the
  769. 29:11teleport data that's going to be this
  770. 29:13current games' uh job ID and so when we
  771. 29:16send that over to the second place we
  772. 29:18can see that there is a difference
  773. 29:20between job IDs so what we're going to
  774. 29:22do is drop a line down here in teleport
  775. 29:24data we're going to say job ID equals
  776. 29:27game . jobid and it's it's as simple as
  777. 29:31that and so once we have that taken care
  778. 29:33of what we're also going to do is print
  779. 29:35what this actual job ID is inside of the
  780. 29:37main game's output so that we know that
  781. 29:39there is a difference so we're going to
  782. 29:40say print open close parentheses game.
  783. 29:43jobid like this and so once we have that
  784. 29:45taken care of let's go into place two
  785. 29:48all right so we're in place two we're
  786. 29:49going to drop a line down here and we're
  787. 29:51going to make the same print statement
  788. 29:52by saying game. jobid like this and now
  789. 29:57what we're going to do is is specify uh
  790. 29:59the job ID property or the job ID data
  791. 30:03so we're going to say local job ID
  792. 30:06equals teleport data. jobid like that so
  793. 30:10now we're going to do is print um
  794. 30:13previous places job ID and then
  795. 30:18concatenate the job ID like this and so
  796. 30:21now essentially what's going to happen
  797. 30:23is we're going to start from the main
  798. 30:25game so the main game here is is going
  799. 30:28to specify its job ID of the main game
  800. 30:31and it's going to send that over to the
  801. 30:33second place the second place is going
  802. 30:35to print its own job ID and it's also
  803. 30:38going to print the job ID from the
  804. 30:41previous place which is the main game so
  805. 30:44now what we're going to do is hit
  806. 30:45publish on both of these
  807. 30:47games and let's go and try this out all
  808. 30:50right so I'm loading into the main game
  809. 30:51and very quickly when we go to the
  810. 30:53server we can see this long string of
  811. 30:55text that was the job I did of the main
  812. 30:59game's server so now if we hit on server
  813. 31:02in the second game we can see at the top
  814. 31:05that this is our Uh current games' job
  815. 31:09ID which is this ID here and as you can
  816. 31:11see uh it printed the exact same job ID
  817. 31:15from the previous game into this one so
  818. 31:17we can definitely see there's a
  819. 31:18difference between these two and if we
  820. 31:20can capture uh the job ID of a specific
  821. 31:23server that's how we know to send the
  822. 31:26player to a specific server and now I'm
  823. 31:28going to show you what this looks like
  824. 31:30through a practical example okay so
  825. 31:32here's what we're going to do I'm going
  826. 31:34to make it so that when uh let's say one
  827. 31:36of my friends join into the server and
  828. 31:39they are inside of a different place in
  829. 31:41the same game I wanted so that if I hit
  830. 31:43follow on their profile like if I go to
  831. 31:45their profile and follow them into the
  832. 31:47game I want to be spawned into the same
  833. 31:50place that they're in not the same game
  834. 31:52because by default if you were to follow
  835. 31:54uh one of your friends into a Roblox
  836. 31:55game then they would be sent to the main
  837. 31:58game rather than the actual place that
  838. 32:00they're in and so in order for us to be
  839. 32:01able to know which server and which
  840. 32:04place they're in specifically we're
  841. 32:06going to need to know their place ID and
  842. 32:08their job ID and so that's what I'm
  843. 32:10going to be showing you how to do inside
  844. 32:11of the script but it's mostly just going
  845. 32:14to be for um for testing and
  846. 32:17demonstration purposes so here's what
  847. 32:19we're going to do I'm going to go into
  848. 32:20the script and the first thing we're
  849. 32:22going to do is actually comment out the
  850. 32:24reserve server um check right here uh
  851. 32:27the
  852. 32:28Reserve server flag right here because
  853. 32:31this will not work if the if your friend
  854. 32:33is inside of a reserved server you
  855. 32:34cannot join a reserved server and here's
  856. 32:37what we're going to do at the very top
  857. 32:39I'm going to specify if the player if
  858. 32:43the player's name is equal to uh a very
  859. 32:45specific player like my ALT account so
  860. 32:47I'm going to say
  861. 32:49Blasberg then that's going to be the
  862. 32:51name of my ALT account and then I'm
  863. 32:52going to place all of this from here
  864. 32:54inside of here now again this is just
  865. 32:56for testing purposes because because
  866. 32:58what would normally happen is if I was
  867. 33:00inside of a game and I let's say was
  868. 33:02using a matchmaking system to have the
  869. 33:04player join a different game then we're
  870. 33:06going to specify through that rather
  871. 33:08than this check that's happening here
  872. 33:10but as of right now for this
  873. 33:12demonstration I'm going to do this uh
  874. 33:14alt account check and you can do this as
  875. 33:16well with your alt account if you want
  876. 33:17to try and uh play on multiple devices
  877. 33:19at the same time but this is essentially
  878. 33:21what I'm going to do so if let's say I'm
  879. 33:24playing on my alt account then it's
  880. 33:25going to teleport me to this new place
  881. 33:28and if I'm not my ALT account like let's
  882. 33:31say I'm on my main bra braw battle
  883. 33:33account then I want to try and follow um
  884. 33:37my ALT account to the place that he's in
  885. 33:39specifically and there's a property for
  886. 33:41this that we can uh check to see whether
  887. 33:43this is the case or not and that's
  888. 33:45called follow user ID so this is what
  889. 33:47it's going to look like we're going to
  890. 33:48say local follow user ID equals
  891. 33:54player. follow user ID like that and
  892. 33:58we're first going to make a check by
  893. 33:59saying if follow user ID and follow user
  894. 34:03ID does not equal to zero then because
  895. 34:06essentially follow user ID is the thing
  896. 34:08that's passed to us if we follow a
  897. 34:11player specifically through their
  898. 34:12profile and if it's not zero so it
  899. 34:15actually is legitimate then we're going
  900. 34:17to go down here and make that check for
  901. 34:19ourselves and continue with teleporting
  902. 34:22our player to the alt account so now
  903. 34:24what we need to do is fetch the
  904. 34:26information of the player that we're
  905. 34:29trying to follow with the place ID and
  906. 34:31also the job ID now we can do this using
  907. 34:34a PE call because uh this has the
  908. 34:36potential to fail so that's why we need
  909. 34:38to be able to do that so what we're
  910. 34:39going to do is say local success error
  911. 34:43message and then there's going to be
  912. 34:46three other variables here I'm going to
  913. 34:48explain what these are just a little bit
  914. 34:49but we're going to say current uh
  915. 34:52instance Place ID and job ID we're going
  916. 34:55to set this equal to P call
  917. 34:58function function open close parentheses
  918. 35:01enter and then what we're going to do is
  919. 35:03say return teleport service colon get
  920. 35:08player Place instance async open close
  921. 35:12parenthesis and then we're going to pass
  922. 35:14in the follow user ID so follow user ID
  923. 35:18now the reason it's structured like this
  924. 35:20is because get player Place instance
  925. 35:23async returns a tupal and if you
  926. 35:25remember what a tupal is it's not the
  927. 35:27same thing as a table it's basically
  928. 35:29multiple values paired together to have
  929. 35:32this be the return result uh as these
  930. 35:35three variables right here because as
  931. 35:36you know the first two variables success
  932. 35:39and error message that's going to be
  933. 35:40passed back with P call but get player
  934. 35:43instance async is going to pass back
  935. 35:44three values that we need uh in order to
  936. 35:48uh know what place and what server this
  937. 35:51fallo user ID uh person is in I hope
  938. 35:54this part is making sense so far um if
  939. 35:56you need to recap on PE call you can
  940. 35:58watch my data source videos on that but
  941. 35:59I hope that this part is making sense to
  942. 36:01you so far so once we have the
  943. 36:03information of the place ID and the job
  944. 36:04ID that's when we can teleport um the
  945. 36:07player to the follow user ID's uh place
  946. 36:12and um server so what we're going to do
  947. 36:14is say if success so if this was
  948. 36:16successful then we're going to say
  949. 36:18teleport service colon teleport to place
  950. 36:23instance so we're not using teleport
  951. 36:25async we're specifically using teleport
  952. 36:28two player instance we're going to put
  953. 36:30open close parentheses first thing we're
  954. 36:32going to do is specify the place ID
  955. 36:34second thing is specify the job ID and
  956. 36:37then finally we're going to specify the
  957. 36:39player we're teleporting now keep in
  958. 36:41mind for this instance we're just
  959. 36:43passing in one player and it's not a
  960. 36:46table of players so we can just simply
  961. 36:48say player like that and if this was not
  962. 36:52successful then we're going to put a
  963. 36:53warning message for the error message uh
  964. 36:57like this
  965. 36:58for the error message just like that and
  966. 37:01this is essentially the script that we
  967. 37:03we're going to be using uh to have our
  968. 37:05alt account join into the second place
  969. 37:07and then have brawl battle like our main
  970. 37:10account follow uh my my ALT account into
  971. 37:15that specific place and so now I'm going
  972. 37:17to show you what this looks like in game
  973. 37:18so I'm going to hit file hit uh publish
  974. 37:21to roblo make sure you always do that
  975. 37:23and now let me demonstrate this for you
  976. 37:24all right so here's what we have going
  977. 37:26on here so I'm on my ALT account right
  978. 37:28now Blasberg and I've currently been
  979. 37:30teleported to the second place in the
  980. 37:32game so now what I'm going to do
  981. 37:35is go into the Roblox homepage and go to
  982. 37:39my ALT account and I'm going to join his
  983. 37:41game directly so now what's going to
  984. 37:43happen is once I follow him into the
  985. 37:45game it's going to look for the follow
  986. 37:47ID and if it's valid then it's going to
  987. 37:49teleport me to the specific place and
  988. 37:51server that my ALT account is in rather
  989. 37:54than just the lobby or the default Place
  990. 37:56itself so we're going to wait for that
  991. 37:58to load okay and as you can see as soon
  992. 38:00as I joined into the game I
  993. 38:02automatically got teleported to um the
  994. 38:05server and or the place and the server
  995. 38:08that my ALT account was in and so this
  996. 38:10is how we can specify how we can
  997. 38:12teleport uh specific players to specific
  998. 38:14servers now of course there's other ways
  999. 38:16you can do it um but this is one way
  1000. 38:18that I know is very practical to use
  1001. 38:20inside of your Roblox game and so I
  1002. 38:22wanted to demonstrate this example right
  1003. 38:23here now again if things have confused
  1004. 38:25you up until this point then I suggest
  1005. 38:27you re-watching certain parts of the
  1006. 38:28video that you think may have confuse
  1007. 38:30you but this is a really good way to
  1008. 38:32understand the difference between place
  1009. 38:34and the place ID and job ID and how we
  1010. 38:37can um bring and how we can bring
  1011. 38:40players into specific servers because of
  1012. 38:42that and I hope this part has made sense
  1013. 38:43to you so far okay and the last thing I
  1014. 38:46want to show in this video is being able
  1015. 38:48to handle failed teleports because the
  1016. 38:51network can be bad for a lot of people
  1017. 38:53depending on what device they play on
  1018. 38:54and things like that teleports can
  1019. 38:56definitely fail a lot of the time and we
  1020. 38:58need to be able to make sure that if it
  1021. 39:01fails once then we need the server to
  1022. 39:03keep trying to uh teleport the player
  1023. 39:05until it is successful and if we just
  1024. 39:08have one call with teleport async it's
  1025. 39:10not exactly going to work so what we
  1026. 39:12need to do is have a module that
  1027. 39:14basically allows us to safely teleport
  1028. 39:16the player and have it constantly retry
  1029. 39:20uh to make sure that the players is
  1030. 39:21being teleported uh safely and there is
  1031. 39:24a really good module for this that's
  1032. 39:25actually in the documentation I will
  1033. 39:27have a link to this in the description
  1034. 39:29of this video uh it's in the handling
  1035. 39:31fail teleport section and basically what
  1036. 39:34we're going to do is copy this script
  1037. 39:36and have it in a module so that I can
  1038. 39:37show you how this works and I'm going to
  1039. 39:39step through um what the script does and
  1040. 39:42things like that so with the handled
  1041. 39:43fail uh teleport section I'm going to
  1042. 39:45hit copy uh this entire code and we're
  1043. 39:48going to go back to the main game so
  1044. 39:50what I'm going to do is go to replicated
  1045. 39:53storage and I'm going to hit the plus
  1046. 39:54sign and I'm going to insert a module
  1047. 39:57script
  1048. 39:57because this is essentially a module
  1049. 39:59script that has a function that allows
  1050. 40:01us to safely teleport the player to a
  1051. 40:04game with the specified ID and
  1052. 40:06everything like that so I'm going to
  1053. 40:08rename this to Safe teleport and then
  1054. 40:12I'm going to select everything and I'm
  1055. 40:14going to hit control B to paste uh the
  1056. 40:16entire code like so and so now what
  1057. 40:19we're going to do is go to our main
  1058. 40:21script and what I'm going to do at the
  1059. 40:23top here is require our module script so
  1060. 40:26we're going to say local safe teleport
  1061. 40:30equals game. replicated storage colon
  1062. 40:33wait for Child open and close
  1063. 40:36parentheses uh safe teleport and I'm
  1064. 40:38also going to wrap this around in a
  1065. 40:41requir call because we're trying to get
  1066. 40:43a module script just like this and so
  1067. 40:46now what we can do instead of teleport
  1068. 40:48async is that we can actually replace
  1069. 40:50this with safe teleport like this so we
  1070. 40:54can specify the place ID we can specify
  1071. 40:58the uh amount of players inside of a
  1072. 41:00table so we can just say player like
  1073. 41:02this and then we can have our options
  1074. 41:04with our teleport options like this so
  1075. 41:06it's basically the exact same thing as
  1076. 41:08up here with teleport async except we're
  1077. 41:10using the safe teleport module instead
  1078. 41:13of just having one teleport async called
  1079. 41:15because this will uh will serveice way
  1080. 41:18better than if we were to just call
  1081. 41:19teleport async once so now I want to go
  1082. 41:22to the script and try and help you
  1083. 41:24understand what is happening here with
  1084. 41:25this entire script so if we at the very
  1085. 41:27bottom obviously this is a module script
  1086. 41:29and what this is returning is a function
  1087. 41:33and what is this function this function
  1088. 41:35is called safe teleport and basically
  1089. 41:38What's Happening Here is that if we go
  1090. 41:39down to the script we can see that uh we
  1091. 41:41have an event called teleport and it
  1092. 41:43failed so this is within the event of a
  1093. 41:46failed teleportation and if this does
  1094. 41:48happen then what we're going to do is go
  1095. 41:51and use this function which is handle
  1096. 41:53fail teleport so there can be multitudes
  1097. 41:56of reasons why why a Teleport has failed
  1098. 41:58has the server been flooded was it just
  1099. 42:00a simple failure then what we're going
  1100. 42:02to do is have a little delay before we
  1101. 42:05try and see if we can fix this and once
  1102. 42:07we do do this then we're going to call
  1103. 42:10this safe teleport function with the
  1104. 42:13parameters that we've specified here up
  1105. 42:15to this main function right here with
  1106. 42:16safe teleport and so basically What's
  1107. 42:19Happening Here is we have an attempt
  1108. 42:20index and then we have this Loop
  1109. 42:23structure going on here so we have a PE
  1110. 42:25call that's basically going to use the
  1111. 42:28same function we were trying to use with
  1112. 42:29teleport async but it's going to
  1113. 42:31repeatedly do this over and over again
  1114. 42:33so it's going to add the attempt index
  1115. 42:35by one every single time it attempts to
  1116. 42:37do this and if it was not successful
  1117. 42:38then we're going to wait for a retry and
  1118. 42:41then we're literally going to go back up
  1119. 42:43here again and we're going to try
  1120. 42:44teleport async again to then uh have the
  1121. 42:47attempt go up again and then it's going
  1122. 42:49to keep on doing this over and over
  1123. 42:51again until either it has been
  1124. 42:52successful or if the attempt index has
  1125. 42:55reached its limit by five like if it
  1126. 42:57tried it five different times and so
  1127. 43:00it's basically going to return the
  1128. 43:01success and results of whether this was
  1129. 43:03the case or not or it's going to throw
  1130. 43:05in an error of whether this uh did not
  1131. 43:07work or not and so that is essentially
  1132. 43:09the safe teleport module that we are
  1133. 43:12going to be using instead of just simply
  1134. 43:15using teleport async and I hope that
  1135. 43:17this has made sense you up until this
  1136. 43:19point conceptually like once again if
  1137. 43:21there's something you didn't understand
  1138. 43:22just rewatch this part and I hope that
  1139. 43:25this will click to you one day and
  1140. 43:26you'll realize that yeah like all these
  1141. 43:28things do happen for a reason and so
  1142. 43:31that is what I wanted to demonstrate to
  1143. 43:32you as a final part to this episode now
  1144. 43:36with everything that I've showed you up
  1145. 43:37until this point I want you to see if
  1146. 43:39you can make this matchmaking system of
  1147. 43:41basically having players step onto this
  1148. 43:44pad and uh whenever it reaches a certain
  1149. 43:47um threshold like let's say two players
  1150. 43:49I want you to teleport all of these
  1151. 43:51players within the pad to a specific
  1152. 43:54server uh within a different place uh in
  1153. 43:57the game and I also want you to send
  1154. 43:59data that you might find useful to use
  1155. 44:02uh in this other game that you're going
  1156. 44:03to be um playing or you can try and
  1157. 44:05apply this inside of your own game that
  1158. 44:07you're currently uh working on uh
  1159. 44:09because this is a really good practice
  1160. 44:11uh if you want to make a matchmaking
  1161. 44:12system or just have different places
  1162. 44:15within uh the same game so and if you
  1163. 44:18need help with this you can join my
  1164. 44:19Discord server you can ask uh anybody
  1165. 44:21inside of the community to help you with
  1166. 44:23this sort of thing uh because this
  1167. 44:25entire uh learning process is a
  1168. 44:27Community effort and also with the
  1169. 44:28effort of what you put into to learn
  1170. 44:30these things and I want to encourage
  1171. 44:32more of that so that's basically going
  1172. 44:34to be it for this episode um this has
  1173. 44:36been one of my favorite episodes in this
  1174. 44:38uh Series so far because of how long it
  1175. 44:39is and also how much information has
  1176. 44:41been put inside of this video so
  1177. 44:43whatever you can do to help this series
  1178. 44:45by either liking this video commenting
  1179. 44:47or sharing it with anybody else you know
  1180. 44:50um that would be very very appreciative
  1181. 44:52of you and I think that's basically
  1182. 44:54going to be it for this episode if
  1183. 44:56you're still confused confused about
  1184. 44:57some of the concepts that I talked about
  1185. 44:59in this video um especially with things
  1186. 45:01like replicated first with loading
  1187. 45:02screens uh or things with um PE calls
  1188. 45:05like the data stores video I'm actually
  1189. 45:07going to send you a link to the data
  1190. 45:08stores video which I'm going to have for
  1191. 45:10you right here to watch so go ahead and
  1192. 45:11watch that if you haven't already and I
  1193. 45:13will see you in the next episode take
  1194. 45:16care

About this transcript

This page contains the full transcript of Teleport Service (Teleporting, Servers, Send Data) - Roblox Advanced Scripting #26 by BrawlDev, generated from the public captions YouTube serves with the video. The transcript has 9,067 words across 1,194 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.