YouTube2Text

[Data Saving] How to make A Pet Simulator X Game on Roblox - Part 6 — Transcript

by polarisprog · 4,035 words · 660 segments · language en · Watch on YouTube

Full transcript

  1. 0:00hello everyone and welcome back to a new
  2. 0:02video on the how to make a bit Simulator
  3. 0:04Xbox game series in this video I'm going
  4. 0:07to be showing you how to save the areas
  5. 0:09that we bought and the player stats and
  6. 0:12the players coins and gems
  7. 0:14also if you guys want to support me and
  8. 0:17want to have access to all of the
  9. 0:18project files including the one you're
  10. 0:20watching right now they will all be
  11. 0:21available on my patreon in Nintendo all
  12. 0:24tier
  13. 0:24so when recording this video I realized
  14. 0:27that I did not show the INF the
  15. 0:28interface of creating attributes
  16. 0:31so here's how attributes work when you
  17. 0:33create so here's my instance I have a
  18. 0:36part selected if I scroll down and click
  19. 0:39add attribute it will say tell me to
  20. 0:41give my attribute name so for example
  21. 0:44test
  22. 0:45and it will give me it will tell me to
  23. 0:48select the type so string or Boolean I'm
  24. 0:52just going to say Boolean and if I press
  25. 0:54save your attribute should pop up here
  26. 0:56okay so the first thing I'm gonna do is
  27. 1:00go to server script service and I'm
  28. 1:02going to create a new script and I'm
  29. 1:03going to call it data save
  30. 1:06now I'm going to
  31. 1:09remove the print hello world I'm going
  32. 1:12to get some services so local players is
  33. 1:15equal to game come on get service
  34. 1:16players
  35. 1:19and then we need data source service
  36. 1:21silicon data store
  37. 1:24service is equal to game come on get
  38. 1:27service data source service and then I'm
  39. 1:30going to create a reference to server
  40. 1:33storage so local server or maybe
  41. 1:35actually we don't really need that
  42. 1:37I think I'm just going to create a data
  43. 1:41source local data store is equal to
  44. 1:44data store service go and get data store
  45. 1:48and I'm just going to give it a key so
  46. 1:51create the random key for me I'm just
  47. 1:53going to say
  48. 1:55um
  49. 1:56my data store Key
  50. 2:00and in here we are going to get the
  51. 2:02player data so we'll call player data is
  52. 2:05equal to
  53. 2:06and I think we have the folder inside of
  54. 2:10the main server script but I think what
  55. 2:12I'm going to do is just drag it inside
  56. 2:14of the data saver and that should work
  57. 2:17so local player data is equal to script
  58. 2:20dot player data
  59. 2:22and what I'm going to do to prevent this
  60. 2:24from erroring is I'm going to enter the
  61. 2:27main server script and in here I'm going
  62. 2:31to just comment this out or maybe just
  63. 2:33delete it
  64. 2:35but I think I'm just going to comment it
  65. 2:38so
  66. 2:40toggle comment
  67. 2:42and I'm going to go back to my data
  68. 2:44saver so
  69. 2:46blurry data and I'm going to create a
  70. 2:48function for save data so we'll call
  71. 2:50function save data
  72. 2:52and that's of course going to take the
  73. 2:53player as the first argument and another
  74. 2:56function for load data so local
  75. 2:59function and I think I'm going to call
  76. 3:01it load data so load data and that's
  77. 3:05also going to take the player
  78. 3:07and then I'm going to have a function
  79. 3:11layer removing so layer
  80. 3:14removing
  81. 3:17and that's also going to take the player
  82. 3:20and then I'm going to
  83. 3:23create the events so players.player
  84. 3:26added come on connect function load data
  85. 3:29so whenever a new player is added we're
  86. 3:31going to call the load data function and
  87. 3:33whenever a new player left so whenever
  88. 3:38layer removing so whenever a player
  89. 3:40leaves the game come on connect we're
  90. 3:42gonna call the player removing function
  91. 3:46okay so after calling those two
  92. 3:49functions sometimes when you are the
  93. 3:52last player in the server and you leave
  94. 3:55the game the server might shut down
  95. 3:57before you your data gets saved so what
  96. 4:01I'm gonna do is game common bind to
  97. 4:03close function
  98. 4:08and what I'm gonna do is Loop through
  99. 4:10every single player in the game so for
  100. 4:11underscore comma player in pairs uh
  101. 4:15players
  102. 4:16go and get going gets players
  103. 4:19I'm going against players
  104. 4:21dude
  105. 4:23I think I added an extra parenthesis
  106. 4:26now this gets cold whenever you shut
  107. 4:29down little servers or just something
  108. 4:30like that happens
  109. 4:32then we're gonna call that function and
  110. 4:34quarantine don't wrap
  111. 4:37uh save data
  112. 4:40player
  113. 4:43and after doing that what I'm gonna do
  114. 4:45is inside of the player moving function
  115. 4:48I'm going to call the save data function
  116. 4:51so save data player so whenever a player
  117. 4:53leaves the game we are calling the
  118. 4:56play removing function and we are going
  119. 4:58to call the save data function
  120. 5:02now after doing that what I'm going to
  121. 5:04do is
  122. 5:06go back to my saved data function and in
  123. 5:10here I'm going to create a table so a
  124. 5:12table called the data
  125. 5:14and inside of that data table
  126. 5:16it actually it's going to be empty and
  127. 5:19I'm going to Loop through every single
  128. 5:20folder in the player so for underscore
  129. 5:23comma folder in pairs player go and get
  130. 5:27children
  131. 5:30do
  132. 5:31and what I'm gonna do is check if player
  133. 5:35data
  134. 5:37go and finds first child
  135. 5:39folder.name
  136. 5:42then so what what we're doing here is
  137. 5:45basically just checking if the
  138. 5:48blur data folder has a has a this folder
  139. 5:52inside of it so if it does then what
  140. 5:54we're going to do is
  141. 5:56check
  142. 5:58if player data if the folder from the
  143. 6:01player data
  144. 6:03has this attribute called save children
  145. 6:06and is equal equal to true so
  146. 6:10what I'm going to do is okay I'm gonna
  147. 6:13explain what this does so
  148. 6:15if any of these folders have this
  149. 6:18attribute called save children
  150. 6:21if it's true then we are going to save
  151. 6:23everything that's inside of that folder
  152. 6:26if it is false then we're not going to
  153. 6:27do that so for example for our pets
  154. 6:30folder I'm going to add an attribute and
  155. 6:32it's going to be a Boolean and I'm going
  156. 6:34to call it save children
  157. 6:38now I do want
  158. 6:41the children from the past folder to be
  159. 6:43saved so all of our pets will be saved
  160. 6:45so I'm gonna do that and then after
  161. 6:49doing that I'm going to go back to the
  162. 6:50script
  163. 6:52and what I'm gonna do
  164. 6:54is
  165. 6:56so data
  166. 6:58folder.name
  167. 7:01is equal to an empty table so we are
  168. 7:03creating another table inside of that
  169. 7:04table
  170. 7:06and what I'm gonna do is check
  171. 7:10if blur data folder.name calling
  172. 7:14attributes save children values so
  173. 7:18if that folder
  174. 7:20if you want to save the values of the
  175. 7:22children inside of a certain folder for
  176. 7:24example our leader stats so we want we
  177. 7:28want it to save the coins and gems but
  178. 7:30we also wanted to save the children
  179. 7:32values so what I'm going to do is just
  180. 7:35go to my leader stats and I'm going to
  181. 7:37add an attribute and it's going to be
  182. 7:41a
  183. 7:42Boolean again and save children values
  184. 7:49now I'm going to make sure that this is
  185. 7:51checked
  186. 7:52because we do want to save our coins and
  187. 7:54gems and let's say you have a currency
  188. 7:56that you don't want to save actually
  189. 7:58we're going to get to that later
  190. 8:00so now what I'm going to do is for
  191. 8:03underscore commit child
  192. 8:05in pairs
  193. 8:07folder call and get children
  194. 8:11do
  195. 8:12so we are looping through all the
  196. 8:14children inside of that folder that I'm
  197. 8:17gonna check if not
  198. 8:20a child can get attribute
  199. 8:25do not do not save value then
  200. 8:31so maybe you won't
  201. 8:33some values to save but some values do
  202. 8:36not save so for example I want my
  203. 8:41sensitive values value to not save then
  204. 8:43I'm going to add a
  205. 8:45string value
  206. 8:47and I'm going a string attribute and I'm
  207. 8:50going to call it do not save value
  208. 8:53however we don't the uh
  209. 8:57this is only going to work if the values
  210. 9:01folder
  211. 9:02has the Boolean called save children
  212. 9:07and it's set to true so
  213. 9:09we're going to save all the children
  214. 9:11inside of the folder so if this happens
  215. 9:13we are going to save all the children in
  216. 9:16the folder
  217. 9:17but We're Not Gonna Save the value of
  218. 9:20this sent to value
  219. 9:22because it has this attribute called do
  220. 9:24not save value
  221. 9:26and
  222. 9:27this is also only going to work if we
  223. 9:30also have these save
  224. 9:33children values
  225. 9:37and it's going to be a Boolean again so
  226. 9:39if we want to save the children values
  227. 9:40we're going to do that and we also go
  228. 9:42and we are also going to save the
  229. 9:45children
  230. 9:46but we're not going to save the
  231. 9:49value of the sent to Value so I'm going
  232. 9:52to get rid of this I want this both of
  233. 9:54these to be false and I'm also going to
  234. 9:56remove this attribute
  235. 9:58now what I'm going to do is table don't
  236. 10:01insert so table dot insert and data
  237. 10:07square brackets folder.name
  238. 10:10oh no
  239. 10:12a table child dot name
  240. 10:16child.name comma child dot value
  241. 10:21comma child dot class name
  242. 10:26okay so we are saving we are adding a
  243. 10:33a table inside of the
  244. 10:36table that we just added so this table
  245. 10:38right here we are adding another table
  246. 10:40inside of it and that table will contain
  247. 10:43uh the properties of the child so the
  248. 10:47child name the child value
  249. 10:50and the child class name now I'll we're
  250. 10:54gonna see why this is useful why why
  251. 10:56we're gonna use the class name later
  252. 10:58so what I'm going to do after that in
  253. 11:01here I'm just going to
  254. 11:05put an else right here
  255. 11:07so if we
  256. 11:10don't have the safe children values
  257. 11:15then what I'm gonna do is
  258. 11:18we're gonna do that again so for
  259. 11:20underscore come a child in pairs let's
  260. 11:23go and get children do
  261. 11:27and what we're going to do is again
  262. 11:28check if it doesn't have the do not save
  263. 11:31value string
  264. 11:35or attributes and what we're gonna do
  265. 11:37this time is just
  266. 11:39Tableau insert data square brackets
  267. 11:42folder.name and child.name and
  268. 11:45child.class name so we are not saving
  269. 11:47the value so if we we are saving the
  270. 11:50children values then we are going to add
  271. 11:52the value of the child to the table if
  272. 11:55we are not doing that then well we're
  273. 11:58not going to save the child value we're
  274. 11:59only saving the child name and the child
  275. 12:03class name this is getting kind of
  276. 12:04confusing for me to explain and I'm
  277. 12:07really bad at explaining so sorry about
  278. 12:09that
  279. 12:10now what I'm going to do is after this
  280. 12:13big for Loop right here
  281. 12:15I'm going to go down and local success
  282. 12:19comma error MSG so error message is
  283. 12:22equal to P call function
  284. 12:25and data store
  285. 12:27so the data server that we created right
  286. 12:29here going save async so we are saving
  287. 12:33the data
  288. 12:34con save set async sorry
  289. 12:37uh player don't user ID
  290. 12:41comma actually sorry about user ID dot
  291. 12:44dot
  292. 12:45B
  293. 12:46now if you want a key for this
  294. 12:50I want to add it it's optional but I do
  295. 12:53want to have a key
  296. 12:55and we are going to save the data table
  297. 12:57so
  298. 12:59they don't
  299. 13:01now what I'm gonna do is check if
  300. 13:03success then
  301. 13:06and we're gonna print
  302. 13:08uh saved data
  303. 13:12else
  304. 13:15we are going to warn
  305. 13:17the ER MSG now what this is doing is
  306. 13:22basically
  307. 13:23if saving the data was a success then we
  308. 13:26are going to well print save data if
  309. 13:29it's not then it's not going to error
  310. 13:31this and break the whole script it's
  311. 13:33just going to warn us that it didn't
  312. 13:35work and it's going to tell us what we
  313. 13:36did wrong
  314. 13:38now what I'm going to do is go back I'm
  315. 13:40going to go to the load data function
  316. 13:43and what I'm going to do is Loop through
  317. 13:46so for underscore comma V in pairs
  318. 13:50layer data call and get children
  319. 13:53to do and we are going to take every
  320. 13:56single folder and value inside of the
  321. 13:58player data and
  322. 14:00clone it and parent it to the player so
  323. 14:03the colon clone the parent is equal to
  324. 14:06player so we are cloning it then
  325. 14:08parenting it to deep player
  326. 14:10after that local data
  327. 14:13this is just going to be in a uh this is
  328. 14:16going to be set to nil
  329. 14:18so again local success comma error MSG
  330. 14:24is equal to pical function
  331. 14:27and data is equal to and data store
  332. 14:31can get async this time not set async
  333. 14:34get a sync player.user ID
  334. 14:38dot dot key
  335. 14:40comma actually we don't need the comma
  336. 14:43so what what we are doing in here is
  337. 14:46setting a sync and then here we're going
  338. 14:48to get the data that we saved so as you
  339. 14:50can see in here we save the data and the
  340. 14:53key that we gave it is the
  341. 14:54player.userid.key
  342. 14:57and in here we have an empty variable
  343. 14:59called Data it's set to nil and
  344. 15:02here we are setting that data to the
  345. 15:06data that we saved earlier
  346. 15:08now again we are doing the the P call
  347. 15:10for the same
  348. 15:12reason so that it does not error and
  349. 15:15break the entire script now what I'm
  350. 15:16going to do is check if error MSG then
  351. 15:20so if it errors then we are going to
  352. 15:23kick the player so player come on kick
  353. 15:26and we are just going to say uh couldn't
  354. 15:31save data
  355. 15:36couldn't save that I will just okay
  356. 15:38could not
  357. 15:39save data
  358. 15:41now the reason why we are kicking the
  359. 15:43player is so that for example the player
  360. 15:45is going to so the player already played
  361. 15:48the game and grinded and got a thousand
  362. 15:50coins
  363. 15:52so if he leaves the game and rejoins and
  364. 15:55those thousand coins weren't able to
  365. 15:58load if he plays the game and leaves
  366. 16:02again
  367. 16:03it's going to save zero coins so if we
  368. 16:06could not load the data then we are just
  369. 16:08going to kick the player
  370. 16:10but before we do that I'm also going to
  371. 16:12warn the error message
  372. 16:15okay so after that I'm gonna check if
  373. 16:18the data
  374. 16:20is equal to something so if data then
  375. 16:23and I'm going to live through the data
  376. 16:25do
  377. 16:27and I'm going to check if hashtag V
  378. 16:32is greater than zero
  379. 16:34then
  380. 16:35what we're going to do is for X comma C
  381. 16:40now I'll explain what this does later in
  382. 16:42pairs
  383. 16:44V
  384. 16:45do
  385. 16:47and what we're going to do is check if
  386. 16:50player
  387. 16:51do strings I can't find first child C
  388. 16:55square brackets one
  389. 16:58now this is going to be hard for me to
  390. 17:00explain so I'm just going to do that
  391. 17:02later
  392. 17:04so if if that then we're gonna do this
  393. 17:09else we are going to create a new value
  394. 17:13so local value
  395. 17:16is equal to
  396. 17:17instance.new and it's going to be to
  397. 17:21string
  398. 17:22uh C square brackets three
  399. 17:25by the way this is the class name that
  400. 17:27we just saved
  401. 17:28and value dot name is equal to
  402. 17:33C square brackets one
  403. 17:35and value dot value is equal to C square
  404. 17:41brackets two
  405. 17:43and value dot parent
  406. 17:46is equal to player
  407. 17:49square brackets to string I
  408. 17:52okay so now it's time for me to explain
  409. 17:54what this does
  410. 17:56now
  411. 17:58if V is greater than zero this is
  412. 18:00basically the folder inside of the data
  413. 18:02because if you remember inside of each
  414. 18:04inside of the data table
  415. 18:07we created a folder
  416. 18:09a table for the folder that we saved and
  417. 18:13basically V in here means the folder
  418. 18:16that we saved so we gotta check in if
  419. 18:19how how much stuff is in the folder is
  420. 18:22greater than zero so if it's so if there
  421. 18:25is nothing in the folder then we're not
  422. 18:26gonna do anything we're not going to do
  423. 18:28all of this but if there is then
  424. 18:31we are doing from X for X comma C now X
  425. 18:35is the index
  426. 18:37I renamed it to X because I is already
  427. 18:40used here
  428. 18:42and C
  429. 18:44is basically
  430. 18:47the okay so C
  431. 18:50is this
  432. 18:53it's this table that we saved in here
  433. 18:56I don't know if this makes sense but so
  434. 18:58seize the value that we saved
  435. 19:01so C1
  436. 19:03is
  437. 19:05the values name so child.name
  438. 19:08and C2
  439. 19:11is the child's value so child.value
  440. 19:16and in here
  441. 19:18when we are creating the value C3 is of
  442. 19:24course the class name
  443. 19:25and C1 is the name and C2 is the value
  444. 19:29and to string I is basically
  445. 19:34the name of the folder okay so now I'm
  446. 19:37going to test this out and see if it
  447. 19:39works
  448. 19:40so what I'm gonna do is
  449. 19:44so we want to save the pets
  450. 19:47and the leader stats values
  451. 19:51I'm also going to have the save children
  452. 19:56dual value so save children Boolean
  453. 20:00true
  454. 20:03okay so now I'm going to see if this
  455. 20:05works
  456. 20:07so before testing this out into On
  457. 20:09Studio we're gonna go to game settings
  458. 20:11and security
  459. 20:14and enable Studio access to API services
  460. 20:18now if you play the game
  461. 20:21that should hopefully work
  462. 20:24so we have 1500 coins and a thousand
  463. 20:27gems I'm going to get a pet
  464. 20:32so I'm just going to Hash this pet
  465. 20:37and I'm going to change my coins and
  466. 20:41gems value
  467. 20:43so coins will be maybe
  468. 20:471123 and for the gems I'll have it set
  469. 20:50to 542.
  470. 20:55so remember these two values now I'm
  471. 20:57going to leave the game
  472. 20:58and see if this works
  473. 21:01so sprinted saves the data now we are
  474. 21:04going to see if it will load the data
  475. 21:09Okay so
  476. 21:10it couldn't load the data so we are
  477. 21:13going to check why this is happening
  478. 21:16okay so I found the fix all I did is
  479. 21:20check if C square brackets 3 is equal
  480. 21:23equal to nil then value is equal to
  481. 21:25instance dot Nu to string C2
  482. 21:28else the value is equal to instance dot
  483. 21:31Nu two strings C3 now the reason why is
  484. 21:35because if we don't have these save
  485. 21:37children values attributes set to true
  486. 21:40then C3 is not a thing because there is
  487. 21:43nothing in the third index
  488. 21:47so I basically just checked
  489. 21:50if C3 is equal equal to new then C2 if
  490. 21:54not then C3
  491. 21:56so this I think works so if I join the
  492. 22:00game
  493. 22:01I should have a cat saved
  494. 22:05and if I just go ahead and modify my
  495. 22:08coins and gems values so liter sounds
  496. 22:10coins and gems coins 323
  497. 22:14coins uh okay so coins
  498. 22:18for 400
  499. 22:21and 64.
  500. 22:26and then I'm going to stop the game
  501. 22:30and play it again
  502. 22:32and it should save everything so as you
  503. 22:35can see I have 464 coins and 323 gems
  504. 22:39okay so I just found a bug with the
  505. 22:42system so if you have you hatched for
  506. 22:45example two cats it will only load one
  507. 22:48cat and the reason why is because in
  508. 22:50here we are checking if the value is
  509. 22:52already there then we are just updating
  510. 22:54its value so what I'm going to do is
  511. 22:56just get rid of these three lines of
  512. 22:58codes right here and get rid of the end
  513. 23:01in here and I'm going to go to format
  514. 23:03format document and now everything
  515. 23:05should work just fine so I'm going to
  516. 23:07play the game
  517. 23:12and I'm just going to hatch two cards so
  518. 23:16here's the first one
  519. 23:18I'm gonna wait for this animation to
  520. 23:20play and I'm gonna hatch the second one
  521. 23:23okay so now I have two cats and a
  522. 23:26thousand four hundred four hundred and
  523. 23:27eighty coins and I'm going to leave and
  524. 23:30rejoin
  525. 23:35and now we have a thousand for 480 coins
  526. 23:38and we also have two cats
  527. 23:41now what I'm going to do is show you how
  528. 23:43to load the cats into your inventory
  529. 23:48so just enter the x-client local script
  530. 23:52so just go to star player scripts and
  531. 23:54enter X client and I'm just going to
  532. 23:58Loop through so for underscore some of
  533. 24:00the in pairs player top Pets Come and
  534. 24:04Get children
  535. 24:06do and create template the dot name
  536. 24:12and I'm also just going to
  537. 24:16wrap this in accordance so quarantine
  538. 24:2314 dot wrap
  539. 24:26and it's just going to take the function
  540. 24:29so create templates comma V Dot name
  541. 24:34okay so just do this and also make sure
  542. 24:36to add a weight in here so it has to
  543. 24:38wait five seconds and if you play the
  544. 24:40game now
  545. 24:41we should have two cats and two cats
  546. 24:45loaded onto our inventory so if I wait a
  547. 24:47bit
  548. 24:48they should load and now we can equip
  549. 24:50them oh we can't equip them
  550. 24:53okay that's a problem we're gonna have
  551. 24:55to fix
  552. 24:57okay so it says attempt to index nil
  553. 25:01with concleral children so
  554. 25:05I'm gonna go ahead and try to fix that
  555. 25:07okay so I just found out why and it was
  556. 25:10very simple just
  557. 25:13copy this
  558. 25:16copy these lines of codes of codes right
  559. 25:18here that we commented and go back to
  560. 25:21our data save script and just
  561. 25:24face them here
  562. 25:26and remove the
  563. 25:28comment so this local folder is equal to
  564. 25:32that and Dot parents is equal to
  565. 25:33workspace dot main folder
  566. 25:35unscoreworkspace.playerpets
  567. 25:37and that should work now if I play the
  568. 25:40game I should
  569. 25:41be able to equip my pets
  570. 25:46I'm just going to open up the pets
  571. 25:48inventory and I'm going to equip a path
  572. 25:50and as you can see it works and both of
  573. 25:52them should work
  574. 25:54okay so they both work
  575. 25:56now what I'm going to do is show you how
  576. 25:58to save the areas so if I go to my areas
  577. 26:00I added a an attribute safe children and
  578. 26:04Etc true
  579. 26:05but if you play the game
  580. 26:11there is itself says purchase
  581. 26:16and we still have to buy it
  582. 26:20so I'm gonna show you okay so uh
  583. 26:24it did save it now I'm going to leave
  584. 26:26the game
  585. 26:27rejoin
  586. 26:33and we do have the area that we just
  587. 26:36bought but if I go here
  588. 26:38then nothing happens so it says interact
  589. 26:42so what I'm gonna do is
  590. 26:47in the main server script we're gonna go
  591. 26:49down and whenever we
  592. 26:51want to purchase a door instead of doing
  593. 26:53this all we have to do
  594. 26:55is check if player so
  595. 27:00we need a way to get the player so what
  596. 27:03I'm going to do is just go back here and
  597. 27:07create a blur added event in here
  598. 27:14and I'm just going to delete this
  599. 27:17and what I'm gonna do
  600. 27:20is just check
  601. 27:23if player okay
  602. 27:28I'm going to Loop through every single
  603. 27:30door
  604. 27:33and what I'm gonna do is check if layer
  605. 27:37on the areas no areas gonna find first
  606. 27:42child
  607. 27:44door.name I'm gonna go back and see if
  608. 27:48okay so area one that should work
  609. 27:51door.name then
  610. 27:53I'm just going to fire a remote event so
  611. 27:57remotes
  612. 27:58we should have a purchase door
  613. 28:03remote function
  614. 28:06so
  615. 28:08I'm gonna see how this works so in here
  616. 28:11when we purchase the door
  617. 28:13where is it
  618. 28:15Bridges doorcon fire client okay all I'm
  619. 28:18gonna do is I'm going to
  620. 28:20add the remote event and I'm going to
  621. 28:22call it destroy door
  622. 28:24or remove
  623. 28:26door so
  624. 28:28remotes
  625. 28:31replica okay replicator storage
  626. 28:35where is it
  627. 28:38replicated storage so again the
  628. 28:41replicated storage spot remotes
  629. 28:43dot remove door calling fire client and
  630. 28:46it's going to take the player
  631. 28:48and what I'm going to do is go back to
  632. 28:50my main client script and right here
  633. 28:53where it says
  634. 28:54okay so I'm gonna go here I'm gonna do
  635. 28:56remotes Dot
  636. 29:00purchase door or don't remove the door
  637. 29:04the online event called connect function
  638. 29:08and I'm just going to do
  639. 29:11take the door
  640. 29:13door on Destroy
  641. 29:16now I'm going to go back to my main
  642. 29:18server and I forgot to send the door
  643. 29:20itself
  644. 29:21okay so now this should work
  645. 29:24if you play the game and you own a door
  646. 29:25it should destroy itself
  647. 29:31oh I forgot to do something
  648. 29:34we have to wait a couple of seconds
  649. 29:36before doing that
  650. 29:44maybe five seconds
  651. 29:49so if I join the game
  652. 29:50after a couple of seconds
  653. 29:53the door gets destroyed and I can go
  654. 29:55through it without having to buy the
  655. 29:57door again
  656. 29:58okay so I think this is going to be it
  657. 30:00for today's tutorial if this helped make
  658. 30:02sure to subscribe like the video share
  659. 30:04it with your friends and I'll see you
  660. 30:05all in the next video bye

About this transcript

This page contains the full transcript of [Data Saving] How to make A Pet Simulator X Game on Roblox - Part 6 by polarisprog, generated from the public captions YouTube serves with the video. The transcript has 4,035 words across 660 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.