YouTube2Text

Creating the Rebirth System! Roblox Studio Simulator Guide Episode 13 — Transcript

by MonzterDEV · 5,002 words · 668 segments · language en · Watch on YouTube

Full transcript

  1. 0:00hey what's going on ladies and gentlemen
  2. 0:01hopefully having a great day in today's
  3. 0:02episode of creating a roblox simulator
  4. 0:04we're going to be creating the rank
  5. 0:06system which is also commonly known as
  6. 0:08the rebirth system as always if this
  7. 0:10video does help you guys out or you do
  8. 0:11enjoy it make sure you smash like button
  9. 0:12also hit the subscribe button and turn
  10. 0:14this post notifications on if you want
  11. 0:15to get notified when i upload more
  12. 0:16roblox development content i also have a
  13. 0:18patreon if you guys like to support me
  14. 0:20and gain access to all the scripts and
  15. 0:21the game file that i make during this
  16. 0:23episode there's a link down below in the
  17. 0:24description and you guys go check that
  18. 0:25out as well with that being said let's
  19. 0:27get into it so to showcase what the
  20. 0:28actual rank system is and how it works
  21. 0:30we're going to go into eating simulator
  22. 0:32which is the simulator that we're
  23. 0:33recreating throughout the series and
  24. 0:35we're going to look at their rank system
  25. 0:36directly so looking at the rank system
  26. 0:38directly this is the first rank that you
  27. 0:39get for completely free and we can see
  28. 0:41right here these are the stats that it
  29. 0:42offers so the damage the hp the gain
  30. 0:45which refers to the food gain and the
  31. 0:47speed multiplier are all multiplied by
  32. 0:49one then if we click on the second rank
  33. 0:50we can see this multiplier changes to
  34. 0:52two on the third rank this changes to
  35. 0:53five and for each rank the number keeps
  36. 0:55increasing another important part is
  37. 0:57that when you purchase a new rank all of
  38. 0:58your coins food and items are reset so
  39. 1:01we want to also make sure to include
  40. 1:02that in our system as well so to start
  41. 1:04adding this this newer game what we want
  42. 1:05to do is we want to go inside the server
  43. 1:07script surface and go to our shop server
  44. 1:09script now inside of the script is how
  45. 1:11we handle all the purchases that the
  46. 1:12player can make from our in-game shop
  47. 1:14and we can see the purchase function
  48. 1:15right here this is called if the player
  49. 1:17does not own the item and they can
  50. 1:18afford to purchase it so once we check
  51. 1:20if they're actually able to purchase it
  52. 1:22we call this purchase function right
  53. 1:23here inside of this function we take
  54. 1:25away the price of the item from the
  55. 1:26player's coin balance and then we also
  56. 1:28modify the player's data by going into
  57. 1:30their inventory and then into the
  58. 1:31specific directory and then into the
  59. 1:33specific tool and we change that value
  60. 1:34to true because they now own it now what
  61. 1:36we want to do is inside of the purchase
  62. 1:38function we want to actually check if
  63. 1:40the shop is equals ranks because then
  64. 1:43we'll know if the player is purchasing a
  65. 1:44brand new rank now above this purchase
  66. 1:46function we want to create a new
  67. 1:48function which can be called something
  68. 1:49like reset or rank purchase or rank
  69. 1:53reset or even rebirth whatever stands
  70. 1:55out to you the most and makes it easier
  71. 1:56to understand i'm gonna go with rank
  72. 1:58reset because when i see rank reset i
  73. 2:00see this has something to do with rank
  74. 2:02and it also has something to do with
  75. 2:03reset so if in the future i'm ever
  76. 2:05trying to debug code or wondering why
  77. 2:07the player's stats are being reset then
  78. 2:08i can look for reset or if i'm trying to
  79. 2:10figure out something to do with ranks
  80. 2:11then i can obviously look for the rank
  81. 2:13keyword and find that exactly here now
  82. 2:15this function is going to take the
  83. 2:16player as an argument the first thing
  84. 2:18that we want to do is we want to do the
  85. 2:20actual reset part so what we want to do
  86. 2:22is we want to modify the player's
  87. 2:23current coin and food balance to zero
  88. 2:26the way that we do that is that we
  89. 2:27access their food and coins that and we
  90. 2:29can see right here that we're actually
  91. 2:30already accessing their coin stats so we
  92. 2:32can simply just copy this paste that
  93. 2:34there and we're gonna set the value to
  94. 2:36zero because we're resetting the amount
  95. 2:37of coins that they have and then we're
  96. 2:38also gonna do this with food as well so
  97. 2:41we're just gonna change coins to food
  98. 2:42and there we go and now we reset both
  99. 2:44the players currencies now on top of
  100. 2:46this we also want to loop through all of
  101. 2:48the players owned tools or own food and
  102. 2:50also their own dna as well and we also
  103. 2:53want to reset those and if you're
  104. 2:54confused by that at all what i mean is
  105. 2:56that when a player purchases a brand new
  106. 2:57rank their food item will be set back to
  107. 2:59the first one or the default one and
  108. 3:01they'll no longer own french fry two
  109. 3:03french fry three four five and all the
  110. 3:04way up to whatever they purchased the
  111. 3:06same goes for dna as well so if they own
  112. 3:08up to the third dna they'll be reset
  113. 3:09back to one and they won't own any of
  114. 3:11these other ones now we'll first start
  115. 3:13with the own tools and the way that
  116. 3:14we're gonna do this is by using a for
  117. 3:16loop so we're gonna say for underscore
  118. 3:17because we're not using the index here
  119. 3:19and we're just going to say child and
  120. 3:21this is going to be a bull value and
  121. 3:23you'll see why in a sec in ipairs and
  122. 3:26now we're going to loop through the
  123. 3:27player.inventory.owned
  124. 3:31tools and now we're gonna get children
  125. 3:33and then that creates the for loop right
  126. 3:35there and if you're confused by this at
  127. 3:36all it's because of how we have our data
  128. 3:38system set up so if we go inside of
  129. 3:39players we go inside of my player we're
  130. 3:41going into the inventory then we're
  131. 3:43going into the owned tools folder and
  132. 3:45when we go into the own tools folder we
  133. 3:47call get children which gets all of
  134. 3:49these children right here and now we
  135. 3:50want to do is we want to say if
  136. 3:53child.name does not equal our default
  137. 3:55tool which we can see this right here as
  138. 3:58long as it does not equal that then we
  139. 4:00want to set the value of the bull value
  140. 4:02to false so we want the player to not
  141. 4:04own that anymore and then we want to
  142. 4:06copy and paste this and we want to do
  143. 4:08the exact same thing for own dnas and
  144. 4:10then of course we're going to change the
  145. 4:12default right here which is french fry
  146. 4:14to the default dna which is retro
  147. 4:16regular so there we go now this will
  148. 4:18reset all of the players own dnas and
  149. 4:20food also known as tools now another
  150. 4:22thing that we need to make sure of
  151. 4:23though is that the player actually
  152. 4:25equips the correct tool because what
  153. 4:27we're doing right now is just setting
  154. 4:28the values all to false as well as
  155. 4:30changing the ones that the player has
  156. 4:32equipped and we actually have a really
  157. 4:33easy and simple to use function up here
  158. 4:35which is called unequipped and we need
  159. 4:36to just pass through the player and the
  160. 4:38shop and what this will do is it'll
  161. 4:40check if the shop is food then it's
  162. 4:41going to set it to the default food
  163. 4:43right here and it will also give the
  164. 4:45player the food as well and we can use
  165. 4:47the exact same function for the dna as
  166. 4:48well it's not going to give the player
  167. 4:50the dna but we don't need to give the
  168. 4:52player the dna so that doesn't matter so
  169. 4:53we're going to call this unequip
  170. 4:54function down here we're gonna say
  171. 4:56unequip we'll pass through the player
  172. 4:58and we'll pass through food that'll give
  173. 4:59the player the specific food item and
  174. 5:01then we'll do the exact same thing for
  175. 5:02dna as well so now that we pretty much
  176. 5:04have this function done what we want to
  177. 5:06do is we want to actually call this
  178. 5:07function inside of the if statement we
  179. 5:09created originally so we're going to say
  180. 5:11rank reset and then just pass through
  181. 5:13the player so let's go into our player
  182. 5:14data script right here and change the
  183. 5:16data store service to just something
  184. 5:18random so that we reset our data we'll
  185. 5:20start our game and we'll test this out
  186. 5:21to see if we're making good progress so
  187. 5:23far so to test this out let's go ahead
  188. 5:24and buy french fry too let's buy the
  189. 5:26second dna as well so now we own
  190. 5:28something other than the default food
  191. 5:29and dna and then the rank let's go ahead
  192. 5:31and purchase the rank we have currently
  193. 5:33480 coins and let's get ourselves some
  194. 5:35food as well so there we go now let's go
  195. 5:36ahead and purchase the second rank we
  196. 5:38can see our coins and our food have been
  197. 5:39reset to zero and the food and dna items
  198. 5:42have both been reset to the default ones
  199. 5:44as well we also just spotted a little
  200. 5:45bug as well we can see that when i
  201. 5:46equipped it the new food item we
  202. 5:48actually forgot to remove the previous
  203. 5:50food item as well so we're still left
  204. 5:51with french fry 2 and french fry 1.
  205. 5:54luckily because of the way that our
  206. 5:55system actually works their food isn't
  207. 5:57increased by using the french fry 2
  208. 5:59items we're getting two food no matter
  209. 6:00what food item we actually use so at
  210. 6:02least it's not easily exploitable we're
  211. 6:04based on the tool that the player has
  212. 6:05equipped they could get a lot more money
  213. 6:07for instance now the area that we're
  214. 6:08going to apply this fix to is actually
  215. 6:10the give tool function right here inside
  216. 6:12of this function we see that we actually
  217. 6:14already are trying to handle this
  218. 6:16specific issue currently the thing is
  219. 6:17though is that the player's tool is only
  220. 6:20in their backpack if the player does not
  221. 6:22have that tool equipped so if the player
  222. 6:24is holding the tool in their hand the
  223. 6:25tool will no longer be inside their
  224. 6:27backpack it'll actually be inside of
  225. 6:29their character we're going to create a
  226. 6:30new variable inside of here called
  227. 6:32equipped tool and we're going to set
  228. 6:33that to player dot character find first
  229. 6:36child which is up and what we can
  230. 6:38provide into this function is the
  231. 6:39specific class that we're looking for
  232. 6:41and since we're looking for the player's
  233. 6:43tool we are going to say tool if you're
  234. 6:44confused at all by the class name you
  235. 6:46can also think of class name as sort of
  236. 6:48what type an object actually is inside
  237. 6:51of our workspace we can see that i have
  238. 6:52a model right here which is named
  239. 6:54monster and the class name for this
  240. 6:56would be model and then if we look
  241. 6:57inside of monster we can see that there
  242. 6:59are parts inside of here so if we wanted
  243. 7:01to select one of these we would say part
  244. 7:03as that's what these specific objects
  245. 7:05are or we could say accessory or
  246. 7:07humanoid or pants shirt and things like
  247. 7:10that anyways we're gonna look for the
  248. 7:11tool because the players should only
  249. 7:12ever have one tool inside of their
  250. 7:14character at a time anyway and then if
  251. 7:16we find the tool we're then going to
  252. 7:18destroy it we can go ahead walk over
  253. 7:20this plate again we can purchase the
  254. 7:22second fry we can buy a new rank and we
  255. 7:24can see that our first tool was deleted
  256. 7:26and we've been given the new tool as
  257. 7:27well now we should test this twice
  258. 7:29because remember originally as long as
  259. 7:30the player wasn't holding the tool we
  260. 7:32should not experience the original issue
  261. 7:34that we were fixing because we would
  262. 7:36already delete the tool from the
  263. 7:37backpack but for the tool to not be in
  264. 7:39the backpack the player has to hold the
  265. 7:40tool so now as long as we're holding the
  266. 7:42tool we can see once again that it works
  267. 7:44perfectly and that's awesome so earlier
  268. 7:46we created the rank reset function which
  269. 7:48handles resetting all the different
  270. 7:49players stats when they purchase a new
  271. 7:51rank what we haven't done yet is we
  272. 7:53haven't created a function which handles
  273. 7:54the modifiers or the actual rewards of
  274. 7:56using a rank if we look up at the equip
  275. 7:58function we can see that we have an if
  276. 8:00statement right here and if the shop is
  277. 8:02food then we also do some extra work
  278. 8:04like giving the player their specific
  279. 8:05food tool inside of here we're going to
  280. 8:07create an elsif and we're going to check
  281. 8:08if the shop equals ranks note the shop
  282. 8:11does equal ranks then we're going to
  283. 8:12call a new function which is going to be
  284. 8:14equip rank and we're going to accept the
  285. 8:16player and rank which is going to be a
  286. 8:18string so now we can go back to our else
  287. 8:20if statement and we can call the equip
  288. 8:21rank and pass through the player and the
  289. 8:23tool name which would be the rank now
  290. 8:25whenever we equip a new rank we want to
  291. 8:27adjust the player's movement speed and
  292. 8:28their health the way that we can do this
  293. 8:30is by modifying the properties on the
  294. 8:31player's humanoid so we're going to
  295. 8:33create a new variable called humanoid
  296. 8:35and we're going to find that from the
  297. 8:36player so player.character find first
  298. 8:38child humanoid and if we do find the
  299. 8:40humanoid then we want to modify those
  300. 8:42properties we're also going to infer
  301. 8:44that the type of the humanoid variable
  302. 8:46is going to be a humanoid so we can
  303. 8:48easily see all the properties that exist
  304. 8:50so we can see that there's a max health
  305. 8:51property we can see that there's a
  306. 8:52health property and there's a walk speed
  307. 8:55property as well now another thing that
  308. 8:56we want to do is go inside of the
  309. 8:58replicated storage and we want to look
  310. 8:59at the rank config and what we need to
  311. 9:01figure out is based on the specific rank
  312. 9:03that the player equips we want to get
  313. 9:04the multiplier so we can modify the
  314. 9:06player's stats luckily we already handle
  315. 9:08this with the get item function up here
  316. 9:10although it does provide us some extra
  317. 9:12information like the id which is
  318. 9:13something that we're not going to use
  319. 9:15but that's okay we're going to create a
  320. 9:16new variable inside of our if statement
  321. 9:18and that's going to be called the
  322. 9:19multiplier and we're going to set that
  323. 9:21to get item and we'll pass through the
  324. 9:23rank and ranks as the shop name now
  325. 9:26unfortunately because of how we handle
  326. 9:27this function we're returning two
  327. 9:29different things we're returning the id
  328. 9:31and the tool line config so we actually
  329. 9:33need to do is we want to say local
  330. 9:35underscore comma multiplier and what
  331. 9:37we're doing here is we're creating two
  332. 9:39variables and we're assigning it to what
  333. 9:40is returned from the get item function
  334. 9:42so the first variable which would be
  335. 9:44underscore will be equal to the tool
  336. 9:45config line dot id and the second
  337. 9:47variable which is multiplier will be
  338. 9:49equal to the tool config line now we're
  339. 9:51using underscore because we don't plan
  340. 9:53to use the id and in lua you commonly
  341. 9:55use underscore when you don't plan to
  342. 9:56actually use that variable that's why in
  343. 9:58for loops when we don't use the index we
  344. 10:00also use an underscore instead of
  345. 10:01another word there as well additionally
  346. 10:03rather than calling this multiplier we
  347. 10:04could call this config line so that it's
  348. 10:06more accurate and then if we want to we
  349. 10:08could create another variable called
  350. 10:09multiplier once again and we could set
  351. 10:11that to config line dot stat so now that
  352. 10:14we actually have the multiplier let's go
  353. 10:15ahead and modify the player stats we're
  354. 10:17gonna modify the player's max health and
  355. 10:19we're gonna set that to the multiplier
  356. 10:21times 100. you should make a constant up
  357. 10:23here which is basically a variable which
  358. 10:25will never change and we could say local
  359. 10:28health all in caps that's how contents
  360. 10:30are supposed to work so that you can
  361. 10:31easily identify constants and we're
  362. 10:32going to say 100 or you can even say
  363. 10:34default health if that helps you
  364. 10:35remember what this variable is
  365. 10:37specifically is and then we can replace
  366. 10:39100 with this variable so that it's
  367. 10:41easier to understand and the reason that
  368. 10:42we're using a constant is so that we can
  369. 10:44easily distinguish this from our other
  370. 10:46code and if we come back to the script
  371. 10:47in the future and we can easily identify
  372. 10:49what variable we need to modify to
  373. 10:51simply change the health then we can
  374. 10:52come right here and we can spot that
  375. 10:53very quickly so now that we change the
  376. 10:55max health we also want to change the
  377. 10:57player's current health as well and
  378. 10:58we're just going to set that to the
  379. 10:59players max health so they basically
  380. 11:01fully regenerate all their health
  381. 11:02instantly and then we also want to set
  382. 11:04the players walk speed as well and once
  383. 11:06again i'd recommend creating a constant
  384. 11:07up here too and we can name that default
  385. 11:10walk speed or just walk speed whatever
  386. 11:12you prefer and i'm gonna set mine to 16
  387. 11:14and then we'll say multiplier times
  388. 11:17default walk speed and that's how we'll
  389. 11:18modify the player's walk speed so we can
  390. 11:20now go ahead and test this out by going
  391. 11:21into our game let's go ahead and
  392. 11:23purchase a new rank and we can see that
  393. 11:25we are moving a lot faster now let's go
  394. 11:28ahead and go back to a lower rank and we
  395. 11:29can see that a health indicator did pop
  396. 11:31up for a second and our speed was
  397. 11:33changed as well so we can equip the
  398. 11:34highest rank that we have again and we
  399. 11:35can see that our movement speed
  400. 11:36increases once again an issue that i
  401. 11:38just spotted though is that if we
  402. 11:39unequip a rank it actually doesn't reset
  403. 11:41the player's current rank so we still
  404. 11:43have the fast movement speed but it says
  405. 11:45that we have the default rank equipped
  406. 11:46so we need to fix that as well before we
  407. 11:48apply the fix another thing that i just
  408. 11:50spotted is our give tool function is
  409. 11:51pretty much identical to the equip rank
  410. 11:53except for the fact that we're passing
  411. 11:55in two parameters into the quip rank
  412. 11:57what we could do is we could keep this
  413. 11:59as two parameters although i'd also
  414. 12:01recommend changing give tool to have two
  415. 12:03parameters as well but we could also
  416. 12:05change the equip rank to work the exact
  417. 12:07same way that our give tool does and
  418. 12:08rather than requiring the specific tool
  419. 12:10name to be passed through to this
  420. 12:11function we actually just get the tool
  421. 12:13name by looking at this value right here
  422. 12:15so i figured i would just do the exact
  423. 12:16same thing for the equip rank as well so
  424. 12:18we're going to say local rank equals and
  425. 12:20then we can just copy this right here
  426. 12:22and we can say instead of equipped tool
  427. 12:24it's going to be equipped rank and we no
  428. 12:26longer need to pass through the tool
  429. 12:27name here because we're already getting
  430. 12:29it within the function so to fix the
  431. 12:30original issue that we were just talking
  432. 12:32about all we need to do is we just need
  433. 12:33to add this function to the unequipped
  434. 12:35function as well so now the bottom of
  435. 12:36the equip function looks identical to
  436. 12:38the bottom of the unequipped function
  437. 12:40and realistically we could make the
  438. 12:41unequip and equip function all into one
  439. 12:44considering how much exact same code
  440. 12:45there is but rather than doing that i'll
  441. 12:47just leave it as is that's just an idea
  442. 12:49for you guys if you wanted to do that on
  443. 12:51your own so now the reason that this
  444. 12:52will fix our issue is because whenever
  445. 12:53we call this unequipped function we
  446. 12:55directly change the rank value right
  447. 12:57here and remember the
  448. 12:58player.inventory.equippedrank.value
  449. 13:00will be the rank that's applied up here
  450. 13:02so when we call the equip rank function
  451. 13:03this value will be reset to the default
  452. 13:05value which is noob before this
  453. 13:07function's called so now whenever we
  454. 13:09unequip this it'll reset back to the
  455. 13:10default one and we can test that by
  456. 13:12going into our game and unequipping this
  457. 13:14and we can see we're very slow if we
  458. 13:16equip this and then unequip it we go
  459. 13:17slow and our health resets as well so
  460. 13:19that's perfect now you might be
  461. 13:20wondering when are we going to implement
  462. 13:22the system which modifies the amount of
  463. 13:23food the player gains when clicking
  464. 13:25based on their current rank and we
  465. 13:26actually already did this in the last
  466. 13:28episode if we go into the utils folder
  467. 13:29and we look at the rewards and stats we
  468. 13:31can see that the food multipliers
  469. 13:33actually takes the rank into account
  470. 13:34already so this system is already
  471. 13:36implemented and whenever the player
  472. 13:37clicks their food will be multiplied for
  473. 13:39each specific rank we do also need to
  474. 13:41add damage as well but considering we
  475. 13:42haven't set up a pvp or damage system at
  476. 13:45all yet we'll do that at a later episode
  477. 13:46the last thing that we need to do though
  478. 13:48is we need to actually apply the rank's
  479. 13:49effects to the player when they first
  480. 13:51join the game what we've done so far is
  481. 13:52we actually only apply these effects
  482. 13:54when the player equips that specific
  483. 13:56item from the shop if we go inside of
  484. 13:57our player data script we can see inside
  485. 13:59of here that we actually have a give
  486. 14:00tool function and if we search for where
  487. 14:02that's used at that's actually called at
  488. 14:03the bottom of the setup player data
  489. 14:05which happens when the player first
  490. 14:06joins the game so whenever the player
  491. 14:08first joins the game we want to give
  492. 14:09them the tool that they had equipped
  493. 14:10when they left last time and now we also
  494. 14:12want to apply the effects them from the
  495. 14:14specific rank that they have equipped as
  496. 14:15well we can rename this give tool
  497. 14:17function to something like give items
  498. 14:19that might not be the best name for it
  499. 14:21because it could definitely be confusing
  500. 14:23when i hear items i think physical items
  501. 14:25like tools but at the same time i can't
  502. 14:27think of a better name for the function
  503. 14:28so we'll just call it give items for now
  504. 14:30and if you think of a better name on
  505. 14:31your own you can definitely name it to
  506. 14:33that as well so we're going to go ahead
  507. 14:34and rename that function and we have a
  508. 14:36tool variable right here let's go ahead
  509. 14:37and also create a rank variable as well
  510. 14:39so equipped rank and pretty much what we
  511. 14:41want to do is we can copy all that code
  512. 14:43right there and paste it directly into
  513. 14:45here and we'd be good to go but we'd of
  514. 14:46course have to add the get item function
  515. 14:48and these variables as well the thing is
  516. 14:50though is that it's actually a really
  517. 14:51bad practice to write the exact same
  518. 14:53code in two different scripts and the
  519. 14:55reason for that is because imagine that
  520. 14:56we changed some part of this function
  521. 14:58right here but we forgot that this
  522. 14:59function is also copied directly into
  523. 15:02this file as well and we forget to make
  524. 15:04those changes right here as well one
  525. 15:05example could even be the default health
  526. 15:07imagine we change the default health
  527. 15:08from 100 to 150 in this script but we
  528. 15:11forget to change it over in here that
  529. 15:13could definitely cause some issues and
  530. 15:14it's really easy to forget all of the
  531. 15:16different scripts that you use these
  532. 15:17specific variables in so what we can do
  533. 15:19is we can create a module script to put
  534. 15:21all the specific code into one script
  535. 15:23and then we can call that script from
  536. 15:24all the other scripts that we want to
  537. 15:26use those specific functions or
  538. 15:28variables inside of it's very similar to
  539. 15:30how we made the utils folder and we
  540. 15:31created the rewards and status modules
  541. 15:33in the last episode so what we're going
  542. 15:34to do is inside of the utils folder
  543. 15:36we're going to create a new module
  544. 15:37script you could name it something
  545. 15:39simple as utils this is something that i
  546. 15:41usually do in all of my games my utils
  547. 15:43module usually just has a bunch of
  548. 15:45random little utility functions which
  549. 15:47aren't worth categorizing or putting
  550. 15:49into their own specific module scripts
  551. 15:51because it's way easier to pack a bunch
  552. 15:52of smaller functions into one module
  553. 15:54script than have a bunch of module
  554. 15:56scripts with one function inside of each
  555. 15:57of them although instead of utils you
  556. 15:59could call it something like shop helper
  557. 16:01it really doesn't matter whatever you
  558. 16:03prefer works but for right now i'll name
  559. 16:05this to utils and maybe we'll rename it
  560. 16:06in the future we'll rename the module
  561. 16:08variable to utils so local utils and
  562. 16:11return utils and now we want to do is
  563. 16:13we're going to copy this get item
  564. 16:14function and we'll paste that inside of
  565. 16:16utils so rather than local we're just
  566. 16:18going to say function utils dot get item
  567. 16:21and we can see that we have some issues
  568. 16:22in this so we're gonna require the tool
  569. 16:24config the dna config and the rank
  570. 16:25config and we get that from all right
  571. 16:27here so i'm gonna copy this and we'll
  572. 16:29delete some of these so we don't need
  573. 16:31the server storage we don't need the
  574. 16:32remote but we need the config folder and
  575. 16:34the replicated storage so there we go
  576. 16:36that fixes that issue now on top of that
  577. 16:38we also want to copy this equip rank
  578. 16:41function as well and we'll paste that
  579. 16:42into here so then remove the local and
  580. 16:44rename this to utils.equip rank and then
  581. 16:47we have an error right here so the way
  582. 16:49that we fix that is by saying
  583. 16:50utils.getitem because that's what it's
  584. 16:52named up here and then we're missing the
  585. 16:54default health and the default walk
  586. 16:55speed so we can copy that directly from
  587. 16:58here and we'll paste that right up here
  588. 17:00so there we go and now we want to do is
  589. 17:02we want to delete this we want to delete
  590. 17:04this function since we put that into our
  591. 17:05utils module script and we'll also
  592. 17:07remove the equip rank as well and now we
  593. 17:09want to require the module script inside
  594. 17:11of our shop server script so we want to
  595. 17:12get the server script service game get
  596. 17:16service server script service and then
  597. 17:18we're going to say local utils equals
  598. 17:21require server script service dot utils
  599. 17:24dot utils and there we go and now we can
  600. 17:27say
  601. 17:28utils.equip rank and then we'll fix that
  602. 17:30right here as well and then we also have
  603. 17:32an error if we scroll down a little bit
  604. 17:33further right here so there we go now
  605. 17:35that will all work perfectly fine and
  606. 17:37then we also need to do the same require
  607. 17:39inner player data as well so if we look
  608. 17:41up here we need to add in the server
  609. 17:42script service we don't need the remote
  610. 17:44but we need this utils right here we can
  611. 17:46add the utils right above here and then
  612. 17:47we're gonna do the same thing so rather
  613. 17:49than adding this function here we're
  614. 17:50gonna say utils.equip rank and then
  615. 17:53we'll pass through the player and based
  616. 17:54on how we modify the equip rank function
  617. 17:56we don't actually need the rank variable
  618. 17:58so we can remove that as well and now it
  619. 17:59should be all good to go so we have our
  620. 18:01functions all in one specific script and
  621. 18:03we use these functions in multiple
  622. 18:05different scripts so anytime we need to
  623. 18:06make some adjustments we could just come
  624. 18:07to this one script right here make those
  625. 18:09adjustments and those changes will be
  626. 18:11applied to both the scripts that use
  627. 18:12this so let's go ahead start our game
  628. 18:14and test out our changes let's go ahead
  629. 18:15and equip the rank number two and move
  630. 18:17around and we can see that we're pretty
  631. 18:18fast now let's also restart our game
  632. 18:20once again so we can make sure that the
  633. 18:22rank stats are applied as soon as we
  634. 18:24join the game which they are we can see
  635. 18:25that the speed is retained we still move
  636. 18:28very fast and we also have that equipped
  637. 18:29as well so if we reset it back to the
  638. 18:31default one we're slow and if we join
  639. 18:33the game we should still have the
  640. 18:34default one equipped and yes we are
  641. 18:36still slow so that works perfectly
  642. 18:38additionally just to confirm with you
  643. 18:39guys the multiplier does work so with
  644. 18:40the default rank the multiplier is one
  645. 18:42we only get one food each click if we
  646. 18:44equip the second rank we should have the
  647. 18:46multiplier of two so now when we click
  648. 18:48we have the multiplier of two and that
  649. 18:49works flawlessly awesome with that being
  650. 18:51said ladies and gentlemen that's gonna
  651. 18:52be it for this episode we learned a lot
  652. 18:54of really useful lessons in this episode
  653. 18:56so hopefully you guys did enjoy and
  654. 18:57hopefully you guys did learn something
  655. 18:59if you guys did as always make sure you
  656. 19:00smash the like button also subscribe
  657. 19:02button and turn this post notifications
  658. 19:03on if you want to get notified when i
  659. 19:04upload more roblox development content
  660. 19:06of course i do have a patreon if you
  661. 19:07guys like to support me and gain access
  662. 19:09to all the scripts and the game file
  663. 19:10that i made during this episode there's
  664. 19:11a link down below description and you
  665. 19:13guys go and check that out with that
  666. 19:14being said i hope that you guys have a
  667. 19:15great day and i'll see you guys in the
  668. 19:17next episode

About this transcript

This page contains the full transcript of Creating the Rebirth System! Roblox Studio Simulator Guide Episode 13 by MonzterDEV, generated from the public captions YouTube serves with the video. The transcript has 5,002 words across 668 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.