YouTube2Text

How to make A Pet Simulator X Game on Roblox - Part 8 — Transcript

by polarisprog · 2,198 words · 327 segments · language en · Watch on YouTube

Full transcript

  1. 0:00hi everyone and welcome back to a new
  2. 0:02video on the how to make a bit similar X
  3. 0:04star game series in this video what
  4. 0:06we're going to be doing is covering how
  5. 0:08to save your equipped pet so when you
  6. 0:11leave and rejoin the game your patch
  7. 0:13should be equipped automatically and how
  8. 0:17to make different paths deal different
  9. 0:19amounts of damage so each path has his
  10. 0:21own damage value
  11. 0:23and also we're going to be fixing the uh
  12. 0:27data saving script
  13. 0:30also if you guys want to support me and
  14. 0:32want to have access to all of the
  15. 0:33project files including the one you're
  16. 0:35watching right now they will all be
  17. 0:36available on my patreon in Nintendo tier
  18. 0:40okay so the first thing we're gonna do
  19. 0:42is fix the data store so what I'm going
  20. 0:45to do is enter my data safe script and
  21. 0:47I'm going to scroll down to the load
  22. 0:48data function now what I realized is the
  23. 0:51bug of the value multiplying happens
  24. 0:54when you have a value a default value
  25. 0:57inside of the folders so to fix that
  26. 1:00it's very simple I'm gonna get rid of
  27. 1:02this so just delete this and remove this
  28. 1:05else right here and this end right here
  29. 1:08and what I'm going to do is check if
  30. 1:10it's a default value so just if okay so
  31. 1:15if player data which is this
  32. 1:17uh the the folder that contains all the
  33. 1:20default folders and values so if player
  34. 1:23data can't find first child to string I
  35. 1:25so the name of the current folders that
  36. 1:27will we are looking through uh common
  37. 1:30find first child uh C square brackets
  38. 1:33one so the name of the value
  39. 1:35then then what we're gonna do then this
  40. 1:37is a default value so value is equal to
  41. 1:41a player confined to his child by the
  42. 1:44way now changes to play not player data
  43. 1:46so player will find first child to
  44. 1:49string I
  45. 1:50qualified for his child
  46. 1:53C square brackets one okay else
  47. 1:58just copy this
  48. 2:00and paste it there
  49. 2:03and this should work so go up here and
  50. 2:07reset your data store so my data key
  51. 2:11maybe uh
  52. 2:13just a random number
  53. 2:16and I'm gonna play the game and see if
  54. 2:19this works
  55. 2:20so I'm just going to hatch an egg
  56. 2:24and okay so I hatched an egg and I got a
  57. 2:28cat and what I'm gonna do is just equip
  58. 2:31one
  59. 2:33and I'm gonna see this is gonna work so
  60. 2:35I'm gonna send this
  61. 2:37okay so it works now I'm Gonna Leave the
  62. 2:40game and rejoin and this should
  63. 2:43hopefully work
  64. 2:45[Music]
  65. 2:46so I should have only okay so coins gems
  66. 2:50that's good and values okay so we have
  67. 2:53the cat and we still have area zero so
  68. 2:57we know that this works
  69. 2:59okay so what we're gonna do now is make
  70. 3:02each pet deal a certain amount of damage
  71. 3:04so what I'm gonna do is go to the best
  72. 3:07that I have so I have the cat and the
  73. 3:09one I'm gonna do is go to the to the
  74. 3:12plus icon and I'm just going to add a
  75. 3:14number value to the model and I'm going
  76. 3:16to call it uh damage
  77. 3:20and I'm going to set it to three
  78. 3:23or maybe 30.
  79. 3:25and what I'm going to do is add a value
  80. 3:28inside of the values folder and it's
  81. 3:30going to be a number value and it's
  82. 3:32going to be named damage
  83. 3:35is going to be set to a default value
  84. 3:37actually just zero sorry and what I'm
  85. 3:40going to do is enter my main server
  86. 3:42script now what we need to do is
  87. 3:44whenever we equip a pad okay so where is
  88. 3:47it uh so uh
  89. 3:49okay so remove the liquid pattern on
  90. 3:51Service events so whenever we equip a
  91. 3:53pet what we need to do is set the
  92. 3:56players damage value so player
  93. 3:58dot values
  94. 4:00stop damage
  95. 4:02dot value
  96. 4:04is equal to and we're going to set it to
  97. 4:08fit model
  98. 4:10damage dot value and this should work
  99. 4:13and when we unequip it what we need to
  100. 4:15do is set it back to zero so
  101. 4:18layer dot values dot damage the value is
  102. 4:20equal to zero
  103. 4:21now what we need to do is enter our uh
  104. 4:25that follower actually it's a main
  105. 4:27client script and what we're going to do
  106. 4:29is down here when we deal the damage
  107. 4:30what we need to do is just change this
  108. 4:33to player dot values Dot and where is it
  109. 4:37so dot damage
  110. 4:39not value and this should work so what
  111. 4:42I'm going to do now is play the game and
  112. 4:43see if this does anything
  113. 4:46so our damage value should be 30 so I'm
  114. 4:49going to play the game
  115. 4:51um got a pet actually I have one saved
  116. 4:53so I'm just gonna play and get this path
  117. 4:56let's check so player pads Polaris prong
  118. 4:59the cast damage value of 30 and I'm
  119. 5:01going to try to damage a drop
  120. 5:03and shoot them okay so it applies okay
  121. 5:05so it's 30 so it works so we know that
  122. 5:08this works
  123. 5:10and I'm going to double check by just
  124. 5:13changing the damage value
  125. 5:16to okay where is it
  126. 5:18where is it
  127. 5:21uh okay damage I'm going to change this
  128. 5:23to uh 10 and I'm gonna see if this works
  129. 5:26so just play the game
  130. 5:28and
  131. 5:32wait for this to load get the card send
  132. 5:35it and now it should deal 10 damage so
  133. 5:38we know that this works
  134. 5:40okay so now we need to check if this
  135. 5:42will save so I'm going to leave the game
  136. 5:44because we don't want this to save
  137. 5:47Play It Again
  138. 5:49[Music]
  139. 5:51and it should not save
  140. 5:54okay so it does not say which is a good
  141. 5:56thing
  142. 5:58okay now what we need to do is save the
  143. 6:00currently equipped pad
  144. 6:03so what I'm going to do is just go here
  145. 6:05to the values folder and I'm going to
  146. 6:07add a not a string value
  147. 6:12and I'm going to rename it
  148. 6:14to
  149. 6:15something like uh equipped
  150. 6:20pet
  151. 6:21and the value will be nothing or maybe
  152. 6:23it will be just none
  153. 6:26and what I'm going to do is go to okay
  154. 6:29where is it I'm going to go to my main
  155. 6:33server script and whenever we equip the
  156. 6:35pet what we need to do is player the
  157. 6:38values dot equipped pets
  158. 6:42thought value
  159. 6:43is equal to and we're going to set set
  160. 6:46it to the pet model's name so pet model
  161. 6:48dot name or just a bit name
  162. 6:50that name
  163. 6:51now what we need to do is
  164. 6:55we're going to do the same thing here
  165. 6:56when we unequiv the path but we're going
  166. 6:58to set it to none again
  167. 6:59[Music]
  168. 7:01okay so now when we
  169. 7:03play the game going deep when a new
  170. 7:05player is added what we need to do is
  171. 7:08have a character added event so player
  172. 7:11got character added go and connect come
  173. 7:14on connect
  174. 7:15character added to go on connect
  175. 7:17function that's going to take the
  176. 7:19character
  177. 7:19and I'm just going to copy this paste it
  178. 7:23here
  179. 7:24and I'm going to change this to two
  180. 7:27seconds
  181. 7:28so just paste that in here and what I'm
  182. 7:31going to do when a new player is added
  183. 7:32is just equip the pest that that we have
  184. 7:37that we had equipped
  185. 7:40so to do that we just we are just going
  186. 7:43to where is it so we need to do this
  187. 7:48but we also need to do the same thing on
  188. 7:50the client so
  189. 7:51what I'm going to do is check if
  190. 7:54if player dot values not equipped
  191. 7:59at dot value is not equal to none so
  192. 8:03it's not equal to none
  193. 8:05then what we're going to do is just well
  194. 8:08do this
  195. 8:09where is it
  196. 8:11so we need to call this remote
  197. 8:14so what I'm going to do is call it from
  198. 8:16the client
  199. 8:18uh so I'm going to add a remote event
  200. 8:21and I'm going to I'm just going to
  201. 8:23duplicate the remote event that I have
  202. 8:25and I'm going to rename this one to
  203. 8:27equip
  204. 8:30saved saved
  205. 8:33pet and I'm going to call it so remote
  206. 8:38game.replicator stores dot remote dot
  207. 8:41equip saved dot equip saved pet confirm
  208. 8:45client and that's going to take the
  209. 8:47player and the layer dot values dot
  210. 8:51equipped
  211. 8:52at dot value
  212. 8:55now what I'm going to do is go back to
  213. 8:57the client so main client script and I
  214. 9:01really hope I have that in here but I
  215. 9:04don't so I'm going to go to the X client
  216. 9:06I think it's here okay
  217. 9:09so
  218. 9:10what I'm gonna do in here
  219. 9:12is whenever that is cold okay so remotes
  220. 9:17call and wait for child go and wait for
  221. 9:19child uh equip saved Pat Donald Cline
  222. 9:24event gonna connect function and that's
  223. 9:27just going to take the uh pet name
  224. 9:32also this okay
  225. 9:34so when this happens what we need to do
  226. 9:38is okay let me think
  227. 9:41equip the pet
  228. 9:45okay so what I did is whenever this is
  229. 9:49called we are calling the on template
  230. 9:51clicked uh function and we are just
  231. 9:54sending scrolling frame confines result
  232. 9:56name I'm going to lower this number
  233. 9:58right here
  234. 9:59and
  235. 10:01what I'm gonna do is go back to the
  236. 10:04server and instead of doing this I'm
  237. 10:06going to wait about
  238. 10:09um
  239. 10:09maybe something like 10 seconds or eight
  240. 10:14then do this
  241. 10:16and I'm gonna see if this works and also
  242. 10:19we have to go to the values folder and
  243. 10:22make sure that save children values and
  244. 10:24save children is is such a truth of the
  245. 10:28attributes should be set to true
  246. 10:30and also we also need to
  247. 10:34okay so this should work now what I'm
  248. 10:37going to do is have a an attribute
  249. 10:39inside of the values that I do not want
  250. 10:41to save so I'm going to add an attribute
  251. 10:43and I'm going to okay so you can't see
  252. 10:46what I'm doing but what I did is press
  253. 10:49the add attribute button and when it
  254. 10:52asks me for the type I press the string
  255. 10:55and I said and I entered the name do not
  256. 11:00save value and I said it and I saved it
  257. 11:04and now I should have an attribute
  258. 11:07now we do not want to save the damage
  259. 11:10value and we also don't want to save the
  260. 11:13center value so same thing and attribute
  261. 11:15do not
  262. 11:18save
  263. 11:19a value
  264. 11:23okay so this should work now what I'm
  265. 11:25going to do is go to my saved data
  266. 11:27function on the data save script and
  267. 11:30where is it so do not save value if not
  268. 11:33child go and get attribute do not save
  269. 11:35value oh
  270. 11:37yeah I I just realized that we already
  271. 11:40scripted that
  272. 11:42so I'm just gonna play the game and see
  273. 11:44if this is gonna work
  274. 11:50okay so when we play the game this
  275. 11:52should of course be none
  276. 11:55so where is it values equipped but this
  277. 11:58should be none
  278. 12:00and I'm just going to go ahead and equip
  279. 12:02this and as you can see now it says cat
  280. 12:04now I'm Gonna Leave the game while
  281. 12:06having the cut equipped and when I play
  282. 12:09the game I should
  283. 12:11it should save
  284. 12:14hopefully so values uh
  285. 12:17uh damage did not save okay good now uh
  286. 12:21equip pet and it does save that and as
  287. 12:25you can see my pet will be equipped
  288. 12:26after a bit of time now the other thing
  289. 12:28that we need to do is instead of just
  290. 12:31where is it okay so instead of just okay
  291. 12:33where is the X client so instead of just
  292. 12:36doing this after waiting two seconds we
  293. 12:38need to do this when a remote is cold so
  294. 12:40I'm going to duplicate the remote event
  295. 12:42again and I'm going to call it load
  296. 12:44saved pets and what I'm gonna do is
  297. 12:48remote going away for child load save to
  298. 12:51pads the oncline event come on connect
  299. 12:53function pet name actually no
  300. 12:57that's all we're gonna do now I'm just
  301. 13:00going to paste that in
  302. 13:02so load safety bets uh they're good now
  303. 13:06what I'm gonna just go back to my main
  304. 13:08server script I'm sorry if this gets
  305. 13:10confusing
  306. 13:11okay so character added we're gonna wait
  307. 13:13two seconds and we're gonna get rid of
  308. 13:14this and we are also before we do this
  309. 13:16we're gonna call the sorry game the
  310. 13:19replicator storage dot remotes dot load
  311. 13:23fire client and that's just going to
  312. 13:26take the player
  313. 13:27now I'm going to get rid of these empty
  314. 13:29spaces because we don't need them and
  315. 13:32I'm going to play the game now and
  316. 13:34hopefully this will work so after my
  317. 13:37character is loaded after a bit of time
  318. 13:40it should load everything and it did
  319. 13:42which is great
  320. 13:44okay so now we saved the equipped pad
  321. 13:48and it should also change okay so we did
  322. 13:51change our damage value which is great
  323. 13:54and now we have this working okay so
  324. 13:59that's gonna be it for today's tutorial
  325. 14:00if this helped Please Subscribe like the
  326. 14:03video share it with your friends and
  327. 14:04I'll see you all in the next video bye

About this transcript

This page contains the full transcript of How to make A Pet Simulator X Game on Roblox - Part 8 by polarisprog, generated from the public captions YouTube serves with the video. The transcript has 2,198 words across 327 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.