YouTube2Text

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

by polarisprog · 6,003 words · 951 segments · language en · Watch on YouTube

Full transcript

  1. 0:00everyone today I would like to announce
  2. 0:02that my patreon will now include maps
  3. 0:04and assets for every new series that I
  4. 0:06will start for this pet Simulator X
  5. 0:08Series my patreon now has all the
  6. 0:10scripts in the game this map that has
  7. 0:12three areas and this asset pack that
  8. 0:14includes all of these pests and answers
  9. 0:17that you see right here that will help
  10. 0:18you with your simulator if you guys are
  11. 0:20interested all of this is available on
  12. 0:22my patreon in kitten doll tier the link
  13. 0:25will be in the description and the
  14. 0:26pinned comment and by the way this map
  15. 0:28and all of these assets were made by
  16. 0:30wool Aussie follow him on Twitter at
  17. 0:32willowzy1
  18. 0:34okay so the first thing we need to do is
  19. 0:37make it so that whenever you click a
  20. 0:38drop this uh the health display
  21. 0:40billboard UI will be enabled and
  22. 0:43whenever you unsend your pet it will be
  23. 0:46disabled so what I have gone ahead and
  24. 0:49did is I select I typed in um Health
  25. 0:52display and I selected all of the health
  26. 0:55display Billboards and I made sure that
  27. 0:58enabled is unchecked and I'm going to go
  28. 1:01ahead and do the same thing for this one
  29. 1:04so just
  30. 1:05uncheck enabled and what I'm going to do
  31. 1:08is
  32. 1:10go to server script service main server
  33. 1:13enter the script and scroll all the way
  34. 1:15down to where we are looping through the
  35. 1:18drops and what I'm going to do is go to
  36. 1:19the remote folder and I'm going to add a
  37. 1:23remote event and I'm going to call it
  38. 1:26I'm going to call it
  39. 1:28um
  40. 1:29Trigger or toggle billboard
  41. 1:33now what I'm going to do is whenever we
  42. 1:36set the center value to the drop what
  43. 1:38I'm going to do is game the replicated
  44. 1:40storage dot remote stop trigger
  45. 1:44billboard.trigger billboard where is it
  46. 1:46oh it was toggle billboard gone fire
  47. 1:49client and that's going to take the
  48. 1:51player and the drop itself and it's also
  49. 1:54going to take whether or not we want it
  50. 1:57to be enabled or disabled but in this
  51. 2:00instance we want it to be enabled so
  52. 2:02true and I'm going to copy this line of
  53. 2:05code and whenever we are setting this to
  54. 2:07the drop we're going to paste that in
  55. 2:09and now we are going to paste it in here
  56. 2:12but what I'm going to do is this time
  57. 2:15it's going to be false
  58. 2:17and I'm going to enter the
  59. 2:22main client script and I'm going to
  60. 2:24scroll down and right here I'm going to
  61. 2:27type in remotes dot I guess the remote
  62. 2:31dot
  63. 2:32um I think it was toggled
  64. 2:34billboards.onclined event call invent
  65. 2:36function call connect function and
  66. 2:38that's going to take the drop and it's
  67. 2:41also going to take a Boolean so Boo
  68. 2:44and what we need to do is drop the
  69. 2:47health health display dot enabled
  70. 2:53is equal to and it's going to be the
  71. 2:56bull value so boom now what I'm going to
  72. 2:59do is copy this line of code and I'm
  73. 3:01going to do the same thing when we
  74. 3:03destroy the drop and respawn it so
  75. 3:05whenever we respawn it we need to set
  76. 3:07the enabled property of the health
  77. 3:09display to false
  78. 3:11now I'm going to play the game and see
  79. 3:13if this is going to work
  80. 3:16so I already hatched some pads so I have
  81. 3:19a cat right here so what I'm going to do
  82. 3:21is just send it here and as you can see
  83. 3:24it's now enabled
  84. 3:26and when it goes down
  85. 3:29actually I'm going to unsign the cat and
  86. 3:31now it's disabled and it's enabled again
  87. 3:35and when it destroys it should be
  88. 3:38enabled when disabled when it responds
  89. 3:40okay so we know that this works
  90. 3:43okay so now we need to display what
  91. 3:46paths are inside each egg so what I'm
  92. 3:48gonna do is Select my egg model or mesh
  93. 3:53and I'm going to press the plus icon and
  94. 3:55I'm going to create a billboard GUI and
  95. 4:00I'm going to set the size of this
  96. 4:01billboard gy so size to something like Z
  97. 4:05like uh maybe 20 comma zero comma 20
  98. 4:09comma zero
  99. 4:12and I'm going to
  100. 4:14okay so now I need to set its adorni to
  101. 4:18the egg itself and I'm going to add a
  102. 4:21frame to it now this Frame the size of
  103. 4:24this Frame is going to be
  104. 4:26um zero point uh three comma zero comma
  105. 4:310.5 or maybe zero point
  106. 4:34uh three comma zero
  107. 4:37and I'm going to position it actually
  108. 4:40I'm going to resize it so
  109. 4:43uh maybe 0.4
  110. 4:46actually that's a bit too big so 0.3
  111. 4:525
  112. 4:55or three four okay that's perfect so
  113. 4:58what I'm gonna do now is position it
  114. 5:00actually I'm going to set its Anchor
  115. 5:01Point to 0.5 and what I need to do now
  116. 5:05is set its position
  117. 5:07to 0.5 comma 0 comma 0.5 comma zero now
  118. 5:12it's in the middle and the mixture that
  119. 5:14always on top so where is always on top
  120. 5:17on the billboard gy not the frame is
  121. 5:19checked and now I'm going to mess around
  122. 5:22with the position of this Frame so
  123. 5:24position maybe zero point
  124. 5:27um
  125. 5:27two
  126. 5:30or 0.1
  127. 5:34and now we're gonna need to rescale the
  128. 5:37entire thing so size uh maybe
  129. 5:4130.
  130. 5:42and now we can scale down the frame so
  131. 5:46Point uh point
  132. 5:50two nine
  133. 5:53and position
  134. 5:550.2
  135. 5:57and size resize it down again so 0.23
  136. 6:03okay I think that this is perfect
  137. 6:06so what I'm gonna do is actually we need
  138. 6:08to position it a bit more uh down so 0.3
  139. 6:13or 0.25
  140. 6:15okay I think that this is
  141. 6:17this is the settings that we are gonna
  142. 6:19need and what I'm gonna do now is add a
  143. 6:22UI corner to it and I'm going to set its
  144. 6:26Corner radius to 0.1 comma 0 or
  145. 6:300.05 comma zero and what I'm going to do
  146. 6:33now is add a UI gradient to it so
  147. 6:36gradient
  148. 6:38and I'm going to set its rotation to 90
  149. 6:40degrees and I'm going to change its
  150. 6:43color to
  151. 6:45okay so color from a nice dark blue
  152. 6:51dark blue to a lighter blue
  153. 6:58okay I think that this is good enough
  154. 7:01for now or maybe we can just make it
  155. 7:03white
  156. 7:05so from from white to a dark gray
  157. 7:11or light gray
  158. 7:13and I think that looks good
  159. 7:15so what I'm gonna do next is I'm going
  160. 7:18to add a a
  161. 7:21UI grid layout to it and I'm going to
  162. 7:25add a text button or maybe a yeah a text
  163. 7:30button would be good
  164. 7:31I'm going to change its size
  165. 7:35so actually I'm going to change its
  166. 7:37color so just set its border size pixel
  167. 7:41to zero and I'm going to add a UI corner
  168. 7:45to it and I'm going to set the corner
  169. 7:46radius to 0.1 comma 0 and then or maybe
  170. 7:50okay that's good
  171. 7:52then I'm going to change the text to
  172. 7:54nothing
  173. 7:56and then I'm going to
  174. 7:59change the color so I'm going to add a
  175. 8:02UI gradient again
  176. 8:04and I'm going to make the color
  177. 8:07go from
  178. 8:08okay so maybe this time it's going to be
  179. 8:13from okay blue to a little bit of a
  180. 8:17darker blue or a lighter one
  181. 8:22okay I think that this
  182. 8:25I think that this is good enough so I'm
  183. 8:27going to rotate it again so 90 degrees
  184. 8:30and now what we need to do is select the
  185. 8:34UI grid layout and I'm going to change
  186. 8:37the fill Direction
  187. 8:40to actually it's called horizontal
  188. 8:42alignment to Center and the vertical
  189. 8:46alignment to Center
  190. 8:48now I'm going to change the size of my
  191. 8:52button so actually we need to do that
  192. 8:54from the Y grid layout so cell size uh
  193. 8:57offset zero offset zero on the Y and on
  194. 9:01the scale for the X it's gonna be Point
  195. 9:04uh 0.3
  196. 9:06or maybe okay 0.3 and for the Y I think
  197. 9:10it's going to be 0.2
  198. 9:12or 0.3 again on the actually Point okay
  199. 9:15so point two five on the Y
  200. 9:18or maybe
  201. 9:200.29 on the Y and point
  202. 9:240.4 on the actually point I think I
  203. 9:27think 0.3 was good
  204. 9:29so 0.2500 y
  205. 9:33and how many can we fill now
  206. 9:36okay that's good enough
  207. 9:38so we can have uh that many pets
  208. 9:42okay now what I'm gonna do is actually
  209. 9:45I'm gonna go to
  210. 9:47the UI grid layout again and I'm going
  211. 9:50to change the cell padding from scale to
  212. 9:53offset from offset to scale so I'm going
  213. 9:55to have multiple uh cells and I'm going
  214. 9:59to solve my y grid layout and I'm going
  215. 10:01to change the scale the offset to zero
  216. 10:05and the offset to zero on the set on the
  217. 10:07cell padding too and now we need to
  218. 10:10change the scale so I'm gonna have it at
  219. 10:14point
  220. 10:15zero five
  221. 10:17or point zero two and on the Y point
  222. 10:21zero zero point zero
  223. 10:26one or 0.02 okay that's perfect okay
  224. 10:31now I'm just going to get rid of most of
  225. 10:34these and I'm going to only leave one
  226. 10:37and I don't think that's the perfect
  227. 10:39square so I'm just going to go back to
  228. 10:42the size
  229. 10:44on the Y and I think this should be 0.26
  230. 10:49okay 0.26
  231. 10:52or
  232. 10:54okay now that's perfect
  233. 10:56now what I'm going to do is rename this
  234. 10:57to templates
  235. 11:01and I'm going to have a frame inside of
  236. 11:03it and the size of this Frame will be
  237. 11:06one comma zero comma one comma zero and
  238. 11:08the background transparency will be one
  239. 11:11and we need to rename this to viewport
  240. 11:14now what we need to do is Okay so we've
  241. 11:18done that now we need a text label to
  242. 11:21display the Rarity so size uh one comma
  243. 11:25zero comma
  244. 11:270.3 comma zero now I'm going to position
  245. 11:30it downwards so the position this will
  246. 11:33be a one or maybe a zero point uh 0.5
  247. 11:41or
  248. 11:430.6 or 7. okay seven is good now
  249. 11:47background transparency to one and I'm
  250. 11:49going to change the text scalp property
  251. 11:52to true and the text color three to a
  252. 11:56nice white and the text okay so the font
  253. 11:59should be for a Docker one
  254. 12:01so where is it
  255. 12:05for a doka one and the Okay so we've
  256. 12:09done that and we need to change the text
  257. 12:11to maybe 10 percent
  258. 12:14just for now just so that we can see how
  259. 12:16it will look and I think it looks pretty
  260. 12:18good
  261. 12:20uh maybe a bit bigger so the size of the
  262. 12:23text label point
  263. 12:25four
  264. 12:28but changing the size means that
  265. 12:30actually I'm just going to put it back I
  266. 12:32think that was just good enough
  267. 12:35okay so this will be a chance chance
  268. 12:38label
  269. 12:41and I'm just going to rename this to
  270. 12:44Mainframe
  271. 12:46and now I'm going to rename this to egg
  272. 12:49billboard
  273. 12:50[Music]
  274. 12:51now we can just cut this so right click
  275. 12:54and cut
  276. 12:57and I'm going to scroll down and inside
  277. 13:00of the X client I'm going to paste that
  278. 13:02in
  279. 13:04okay so what we need to do now
  280. 13:07is whenever the player joins
  281. 13:13hmm actually what I'm gonna do is cut
  282. 13:16this and put it inside all of the X by
  283. 13:18default
  284. 13:19so right click pasting to select it
  285. 13:23and uh the adorni make sure that this is
  286. 13:27just new
  287. 13:28so that each model is going to have its
  288. 13:31own billboard gy
  289. 13:34and I'm going to make sure that the
  290. 13:36template that we have inside of each one
  291. 13:39of them is invisible so just select all
  292. 13:42of your templates by holding down
  293. 13:44control and just to make sure that
  294. 13:46visible is unchecked
  295. 13:48okay now what I'm gonna do is and
  296. 13:52disable all these Billboards so enabled
  297. 13:54false
  298. 13:56okay so what we're gonna do is we're
  299. 13:59gonna have we're gonna enter our
  300. 14:02uh where's the X client script and what
  301. 14:06I'm gonna do is I'm going to have a
  302. 14:07function called open and close
  303. 14:10billboards
  304. 14:12[Music]
  305. 14:13and this will take the billboard
  306. 14:18and whether we want to open it or close
  307. 14:20it so I'm just going to call it Bool and
  308. 14:23what we're gonna do is uh if
  309. 14:27if a bull then
  310. 14:30and not is hatching
  311. 14:34then and what we're going to do is we're
  312. 14:36gonna have variable up here called is
  313. 14:38hatching
  314. 14:40and it's going to be set to false now
  315. 14:43what we need to do is else
  316. 14:47and I'm going to scroll down to whenever
  317. 14:49we hatch the egg and when we hatch it we
  318. 14:52need to set is hatching
  319. 14:54true and when we stop hatching is
  320. 14:57hatching will be false
  321. 15:00okay so now we're gonna go up here and
  322. 15:03whenever we do this we're gonna do
  323. 15:05billboard to enabled
  324. 15:07and enabled enabled is equal to true and
  325. 15:11then we need to have a twin so between
  326. 15:14is equal to Twin service command create
  327. 15:17and that's going to take the billboard
  328. 15:19itself and then twin info between info
  329. 15:24dot new and it's going to be 0.2 uh
  330. 15:28comma nm.easant style DOT sign maybe uh
  331. 15:32comma in them is in Direction dot out
  332. 15:35and then we're gonna set its size so
  333. 15:39comma uh curly brackets size is equal to
  334. 15:43and when we open it so where is it so a
  335. 15:48ball
  336. 15:49uh I'm pretty sure we set the size okay
  337. 15:52so use them to use them to Dot from
  338. 15:55scale so we have the X to 20.
  339. 15:59this will depend on what your billboard
  340. 16:01size is uh come up and 30.
  341. 16:06and now we need to play this win so drop
  342. 16:09a line and twin column play now we're
  343. 16:12going to copy all of this paste it right
  344. 16:14here and we're gonna set this to false
  345. 16:17actually it's still going to be true but
  346. 16:20okay so I'm gonna close it
  347. 16:23and then when we play the tween we need
  348. 16:26to change its size this time to from
  349. 16:28using two Dot from scale 0 comma zero
  350. 16:33and then we need to weigh it 0.2 seconds
  351. 16:36so that's the way 0.2 seconds and then
  352. 16:40when this twin is completed then we will
  353. 16:43well uh billboard dot enabled
  354. 16:48uh is equal to false
  355. 16:50but I think what I'm gonna do is instead
  356. 16:52of using tween task that always 0.2
  357. 16:55we're going to do tween
  358. 16:57between dot completed column weights
  359. 17:01[Music]
  360. 17:03and in here we need to change this to
  361. 17:050.1 because I think it will look better
  362. 17:09okay so what we need to do now is uh
  363. 17:13figure out when we should call this
  364. 17:14function so I think I know how to do
  365. 17:17that I'm going to go down here and run
  366. 17:20service dot heartbeat Corner connect
  367. 17:22function
  368. 17:24and what I'm going to do is I'm going to
  369. 17:25Loop through every single leg so for
  370. 17:27underscore comma egg in pears eggs come
  371. 17:32get children do if egg cone is a base
  372. 17:37part then
  373. 17:39what we need to do is local character
  374. 17:43do we have the character
  375. 17:45no so local character so what we're
  376. 17:48doing is looking through every single
  377. 17:49egg and uh
  378. 17:52you can get the character so player
  379. 17:54called character or player dot character
  380. 17:57added calling ways and we're gonna check
  381. 17:59if the character is there so if
  382. 18:01character then so the character is there
  383. 18:04then what we need to do is check if the
  384. 18:07distance between the character and the
  385. 18:10egg is less than 15 studs so if
  386. 18:14brackets and the character
  387. 18:18dot primary part so the humanoid
  388. 18:21parts
  389. 18:23dot position
  390. 18:26uh minus
  391. 18:28egg dot position
  392. 18:31dot magnitude make sure to stop your dot
  393. 18:34magnitude outside of the bracket so dot
  394. 18:36magnitude
  395. 18:37is less or equal to 15 studs then what
  396. 18:42we're going to do is open or close
  397. 18:44Billboards and it's going to take the uh
  398. 18:48egg
  399. 18:49dot egg billboard
  400. 18:53comma true so we're going to open it
  401. 18:56else uh open the workload and close
  402. 18:59Billboards but this time it's going to
  403. 19:01be false
  404. 19:04okay so this should work so I'm gonna go
  405. 19:06ahead and try this out
  406. 19:08for myself so play the game
  407. 19:11I'm going to view the output to make
  408. 19:12sure that everything works
  409. 19:15and when I get close to an egg it should
  410. 19:17pop that up and it should close but I
  411. 19:20think that the closing is way too fast
  412. 19:22so I'm going to go back here and make
  413. 19:25sure that it's set to 0.2
  414. 19:31and now I'm going to play the game and
  415. 19:33see if this is any better
  416. 19:37so when we get close to it it should pop
  417. 19:41it up and yeah that's way too fast
  418. 19:45and what we need to do is whenever we we
  419. 19:48wait for the twin to be completed we're
  420. 19:50gonna faster weight 0.4 seconds again
  421. 19:55so I think this should fix that uh
  422. 19:58flickering glitch that we have
  423. 20:05okay this is a lot smoother but 0.2 is
  424. 20:08way too much
  425. 20:10so 0.1
  426. 20:12and now this is going to look a lot
  427. 20:15better
  428. 20:18okay so yep as you can see this is a lot
  429. 20:22smoother
  430. 20:23and it looks really good
  431. 20:25okay that's that's good now what I'm
  432. 20:28gonna do is make sure that the proximity
  433. 20:30prompt so proximity prompt I'm gonna
  434. 20:33make sure that it's uh that the distance
  435. 20:35is 15 so same as the uh
  436. 20:39um
  437. 20:40billboard so make sure that the max
  438. 20:42activation distance is 15 on all of them
  439. 20:45and what we need to do is make it so
  440. 20:48that the uh so that it displays the
  441. 20:51price of the egg itself
  442. 20:54so to do that it's very simple all we
  443. 20:56need to do is
  444. 20:58enter our main client script
  445. 21:01or actually we have okay so enter X
  446. 21:04server
  447. 21:06and what we need to do when we live
  448. 21:07through the X
  449. 21:10okay so we're gonna require a module so
  450. 21:12local
  451. 21:14um format format module
  452. 21:17is equal to uh require replicator stores
  453. 21:21dot format number out
  454. 21:24and what I'm gonna do is
  455. 21:28um Okay so
  456. 21:32proximity prompt okay so egg
  457. 21:35dot proximity prompt
  458. 21:40uh I think it was it wasn't action text
  459. 21:43what was it
  460. 21:46I think it's called okay so it's okay
  461. 21:50where is it so action text is open but
  462. 21:53I'm pretty sure there was another thing
  463. 21:55object text yes
  464. 21:57so what I'm going to do is uh the action
  465. 22:00text first so action text is equal to a
  466. 22:04number
  467. 22:05alt so
  468. 22:08format number
  469. 22:10format number dot format Compact and
  470. 22:12that's going to take the X price so
  471. 22:17hmm
  472. 22:18when I put these outside of here
  473. 22:23and it's going to be a price
  474. 22:29and then egg dot objects text
  475. 22:34the object text will be open
  476. 22:39now this should look pretty good and I'm
  477. 22:42gonna see if our eggs will still work
  478. 22:45after this
  479. 22:47so I'm gonna play the game and it should
  480. 22:49display the price of each egg
  481. 22:53and it only says open so that does not
  482. 22:55work
  483. 22:56so object text is not a valid number of
  484. 22:58uh
  485. 23:00when your egg oh
  486. 23:02it was egged or proximity
  487. 23:05prompt proximity
  488. 23:08prompt
  489. 23:10now this should hopefully work
  490. 23:17and as you can see it says 500 and open
  491. 23:21and this one is 1.5 K and this one is
  492. 23:243.5 k
  493. 23:26so that does work now what we need to do
  494. 23:29is just clone templates so let's do that
  495. 23:33by just going to
  496. 23:36where is it so
  497. 23:38I'm going to enter
  498. 23:41my
  499. 23:43okay where is it uh okay so I think I
  500. 23:47know how to do this I'm going to enter X
  501. 23:49clients
  502. 23:51and when we are looping through the eggs
  503. 23:55are we even looking 3DX
  504. 23:59okay so we are not looping through the
  505. 24:01eggs so I'm gonna do that right here
  506. 24:05so for underscore comma V in comma egg
  507. 24:09in Paris X call and get children dude if
  508. 24:13egg cone is a base part
  509. 24:19then so if the egg is a base part then
  510. 24:23what we should do is get the all the
  511. 24:27eggs pets so I think we are doing that
  512. 24:30here
  513. 24:32okay so we are not doing that
  514. 24:34okay data is equal to require
  515. 24:38egg dot egg data I think
  516. 24:41our data
  517. 24:43what was it oh did I just delete
  518. 24:45something
  519. 24:46yeah I did
  520. 24:48okay I want to go back so we have a
  521. 24:52module called Data so data so we're
  522. 24:55going to require this and local pets is
  523. 24:58equal to okay so local egg pets not pets
  524. 25:02is equal to egg data
  525. 25:05pets
  526. 25:07let's enter the egg data thing and as
  527. 25:11you can see we have egg pets not pets so
  528. 25:18and what we need to do is Loop through
  529. 25:21the egg pads so
  530. 25:23for underscore comma pet in pairs egg
  531. 25:27pets do
  532. 25:30let's see the way we are doing that from
  533. 25:32X server so we just
  534. 25:35okay so pet stable
  535. 25:40okay that's simple enough
  536. 25:42we're gonna work with that
  537. 25:45so we are just getting the patch table
  538. 25:48okay so pet
  539. 25:51okay so print pet we're just gonna print
  540. 25:55pet dot uh pet name
  541. 25:58we're gonna see what that returns
  542. 26:04so it should give us nil okay so it gave
  543. 26:07us nil so we're gonna see how to fix
  544. 26:08that
  545. 26:10okay so I fixed it all I had to do is
  546. 26:12print that square back as pet name so
  547. 26:15what I'm gonna do is
  548. 26:19a local template
  549. 26:21is equal to uh egg dot billboard dot uh
  550. 26:26egg billboard sorry
  551. 26:28egg billboard dot template
  552. 26:33colon clone
  553. 26:35uh and when we clone it so template dot
  554. 26:39name is equal chip hat square brackets
  555. 26:42uh pet name so pet name
  556. 26:48and then we need to get the actual pet
  557. 26:50model so pit model is equal to that's a
  558. 26:54common finds first child path square
  559. 26:56brackets pet name
  560. 27:02and then template.parent is equal to egg
  561. 27:06dot egg Bill board
  562. 27:09and what I'm gonna do is
  563. 27:13um I'm going to go up here
  564. 27:17to this so create template
  565. 27:22and I'm just going to copy this
  566. 27:24I'm going to copy this entire code
  567. 27:27and by the way this is what I just
  568. 27:29copied
  569. 27:30create a template just copy this
  570. 27:32and scroll down here and just paste that
  571. 27:35in and templates can be template this
  572. 27:38time or new maybe new template
  573. 27:41new templates
  574. 27:43so just change this to new template
  575. 27:45sorry
  576. 27:46so a new templates go and wait for that
  577. 27:48and we are just going to change this to
  578. 27:51pets model
  579. 27:55and this should work so now what I'm
  580. 27:57going to do is just task the weight
  581. 28:00uh three two seconds before doing this
  582. 28:03so when I play the game now and we're
  583. 28:05gonna see if this works
  584. 28:07that's a two seconds one two
  585. 28:10we have nothing so template is not a
  586. 28:14valid number of egg billboard okay
  587. 28:16that's very simple to fix
  588. 28:18uh it's egg billboard dot Mainframe
  589. 28:23dark template and also we need to make
  590. 28:26sure that new template.visible is equal
  591. 28:28to true
  592. 28:30now this is gonna work
  593. 28:32Maybe
  594. 28:39okay so it did work but it did not
  595. 28:41parent them correctly
  596. 28:44so we need to pause the game and when we
  597. 28:46parent it should be the Mainframe
  598. 28:49and we also need to do one more thing
  599. 28:52which is uh change the
  600. 28:56hmm okay actually this is gonna work
  601. 29:01let's see
  602. 29:03so when I go here as you can see it did
  603. 29:06do this but it does not display anything
  604. 29:09and that's I think this is simple to fix
  605. 29:12I think what's causing this is like I'm
  606. 29:16gonna go to the main folder workspace X
  607. 29:19basic tag
  608. 29:21uh egg billboards
  609. 29:24cat
  610. 29:26I'm just going to go to viewport and I'm
  611. 29:28going to change the Z index to 2.
  612. 29:303
  613. 29:32okay so this does not work
  614. 29:36and I think I know why whenever you
  615. 29:38whenever you are doing this I think you
  616. 29:40should clone the uh
  617. 29:42oh
  618. 29:44okay okay let's fix this uh we have to
  619. 29:47create a folder inside of star G1 it's
  620. 29:49going to be called egg Bill boards
  621. 29:54foreign
  622. 29:57[Music]
  623. 29:58we are looking through all the egg build
  624. 30:01boards I'm going to do we're gonna do
  625. 30:02egg
  626. 30:04billboard
  627. 30:06okay so local build board or maybe
  628. 30:09okay so called billboard is equal to egg
  629. 30:12dot egg billboard
  630. 30:16and we're gonna build billboard.parent
  631. 30:18is equal to player gy
  632. 30:21flower gy so we need a reference to
  633. 30:23player gy
  634. 30:26okay so local player gy
  635. 30:32is equal to and player come away for
  636. 30:35child to lower gy
  637. 30:38now we're gonna go down here
  638. 30:41and player
  639. 30:44gy
  640. 30:45dot parent is equal to player gy and
  641. 30:48when we parent it to player gy
  642. 30:52um we just need to Billboards okay so
  643. 30:54billboard Dorney
  644. 30:56is equal to egg
  645. 30:59nothing this should work this time
  646. 31:05so I'm gonna wait two seconds and we
  647. 31:07have a problem
  648. 31:08uh open and close this is not
  649. 31:12okay this is not good
  650. 31:14but I think it's easy to fix all we need
  651. 31:16to do is instead of looking through the
  652. 31:18eggs we need to be looping through the
  653. 31:21billboard so so for underscore command
  654. 31:23billboards
  655. 31:24in pairs all this so if this coin is a
  656. 31:28Billboards DUI let's just do what I'm
  657. 31:31doing so change this to billboard change
  658. 31:34this to billboard and now this is going
  659. 31:37to be eggdol position
  660. 31:41so billboard don't adorney stop position
  661. 31:46dot magnitude
  662. 31:48okay
  663. 31:50this should work
  664. 31:55okay so no errors actually error
  665. 31:59uh exotic billboard oh same thing again
  666. 32:02so just change this to billboard dot
  667. 32:05Mainframe calling clone and change this
  668. 32:07to billboard dot Mainframe
  669. 32:10and now you can play the game and now
  670. 32:13this is gonna work
  671. 32:17uh
  672. 32:18okay nothing works I'm gonna work on
  673. 32:21fixing this and I'll be back
  674. 32:24okay so I fixed everything and all I had
  675. 32:27to do was change okay so in the
  676. 32:29heartbeat what I did was change in pairs
  677. 32:32to uh
  678. 32:34okay so I did player gy dot egg
  679. 32:36Billboards come and get children instead
  680. 32:38of X call and get children and I also
  681. 32:41what else did I did did I do so uh yeah
  682. 32:45I'll change this to billboard.position
  683. 32:48and then down here what I did is parent
  684. 32:51this to player gy direct Billboards so
  685. 32:54egg billboard.parents is equal to player
  686. 32:55gyn.ex Billboards not player gy and now
  687. 32:59everything works fine
  688. 33:03so if you play the game now
  689. 33:06after a bit of seconds as you can see
  690. 33:08this works but we need to show the
  691. 33:12Rarities
  692. 33:13or the chances of getting each pet so we
  693. 33:16just need to change this
  694. 33:19okay so that's
  695. 33:21actually new template dot text Dot uh
  696. 33:25chance label chance label dot text is
  697. 33:29equal to and it's going to be act data
  698. 33:33don't and I think or actually it's gonna
  699. 33:35be a pad square brackets
  700. 33:39and I think it was chance
  701. 33:46and now this should work
  702. 33:50but what I forgot to do is also uh dot
  703. 33:53dot percentage sign so don't don't
  704. 33:56percentage sign
  705. 33:59and if you play the game now then this
  706. 34:01should work
  707. 34:10so as you can see now it does show the
  708. 34:12percentages and everything works fine
  709. 34:16okay so now I need to make it so that
  710. 34:19whenever you
  711. 34:20uh so that you can't hatch your neck if
  712. 34:23you don't have the area where the egg is
  713. 34:25in so
  714. 34:27what I'm gonna do is just
  715. 34:31where is it so
  716. 34:33I'm going to have a
  717. 34:37a string values inside of each egg or
  718. 34:41actually just go inside of the data
  719. 34:44data script itself and do egg
  720. 34:49egg area and this one is going to be
  721. 34:52area zero
  722. 34:54because it's the basic gag
  723. 34:56and make sure to add to add the combo
  724. 34:59now I'm going to do this for all of them
  725. 35:01so the stone egg for me is area two
  726. 35:05and the winter egg
  727. 35:10is area one
  728. 35:15and now this should work
  729. 35:18now we also need to enter our X server
  730. 35:22and whenever we
  731. 35:24press this what we need to do is just
  732. 35:26check if
  733. 35:28[Music]
  734. 35:30player dot coin uh
  735. 35:33areas.valid.com finds first child
  736. 35:38fights with child egg
  737. 35:41data so uh egg area
  738. 35:46then
  739. 35:48we're gonna do all of this
  740. 35:53so now if I do not own the area I should
  741. 35:57not be able to buy the egg
  742. 35:59so I do own this area so I should be
  743. 36:02able to hatch this egg
  744. 36:07but okay so something is wrong with the
  745. 36:10egg hatching so I need to fix this so
  746. 36:12pet model is equal to pets confines with
  747. 36:14child chosen pet dog pet name
  748. 36:16okay
  749. 36:18so the reason why uh the eggs are not
  750. 36:21working anymore is because a model
  751. 36:23should be uh this cone clone
  752. 36:27by the way this is on the uh
  753. 36:29Loop through the eggs on the client
  754. 36:33and now we should be able to Hash the
  755. 36:34EXO now I should be able to hatch this
  756. 36:37one
  757. 36:39but I should not be able to Hash the
  758. 36:41winter rag
  759. 36:42as you can see I can't and I can't hatch
  760. 36:45this one too
  761. 36:47so this works so what we need to do now
  762. 36:49is
  763. 36:51game passes
  764. 36:53okay so here I am in the euroblox
  765. 36:55website and what I'm gonna do is show
  766. 36:57you how to create a game pass so go to
  767. 36:59the create tab on Roblox
  768. 37:02click on it and then go to your
  769. 37:05experience or game and then go to store
  770. 37:09and press add pass
  771. 37:13now we're gonna press choose file and
  772. 37:16just choose an image you can't see what
  773. 37:17I'm doing but it's going to prompt up
  774. 37:19the file explorer if you have a Windows
  775. 37:21PC and just just choose a random image
  776. 37:25I'm just going to try to find one
  777. 37:28and okay so I'm going to choose one real
  778. 37:30quick
  779. 37:34okay so I chose my profile picture and
  780. 37:37now you are going to uh type in your
  781. 37:41game pass name so for me it's times to
  782. 37:43walk speed
  783. 37:46times two speed
  784. 37:50and you're gonna give it a description
  785. 37:51so for me it's just going to be doubles
  786. 37:55your
  787. 37:57walk speed
  788. 37:59your walking speed
  789. 38:02okay so then you hit preview
  790. 38:04then wait for it and verify upload
  791. 38:10now you can go to configure
  792. 38:13so press the uh
  793. 38:15Cog wheel and just press configure and
  794. 38:17go to sales and item for sale and give
  795. 38:20it a price so for me it's going to be
  796. 38:21one Roblox and just press save and go to
  797. 38:24details
  798. 38:25Now You're Gonna Want to Get Your Game
  799. 38:27Pass ID so to do that I'm going to show
  800. 38:29you how to do that right now
  801. 38:31so your game pass ID is this string of
  802. 38:35numbers that are right here so just
  803. 38:37double click on the numbers select them
  804. 38:40from the link right click and press copy
  805. 38:42now you can save those numbers numbers
  806. 38:45somewhere so for me it's just going to
  807. 38:47be my notepad
  808. 38:50okay so now we need to go to Roblox
  809. 38:53studio and what I'm going to do is enter
  810. 38:55my I'm going to create a new script
  811. 38:57actually and I'm going to call it a
  812. 38:59Marketplace
  813. 39:02and I'm going to get Marketplace service
  814. 39:04so local MPS is equal to Gamecock
  815. 39:06Service Marketplace service and local
  816. 39:09players is equal to game come on get
  817. 39:13service get service players and what we
  818. 39:17need to do is players.player added
  819. 39:19command connect function and it's we're
  820. 39:22going to take the player
  821. 39:24and what we're going to do is if
  822. 39:31connect function and that's going to
  823. 39:34take the character
  824. 39:36and we need to check
  825. 39:39if
  826. 39:41Marketplace service call new user owns
  827. 39:43Game Pass async and we're gonna take the
  828. 39:48player's user ID so player.user ID comma
  829. 39:50and The Game Pass ID so times work speed
  830. 39:54is this ID
  831. 39:56so type in your game pass ID that you
  832. 39:58just got and then what we're gonna do is
  833. 40:02just print
  834. 40:05players.name
  835. 40:06dot dot
  836. 40:08has
  837. 40:10two times walk speed
  838. 40:14and then we just we are just going to do
  839. 40:17character dot humanoid
  840. 40:20dot walk speed
  841. 40:22Hulk speed is equal to and 32 instead of
  842. 40:2716 so I'm just going to double check
  843. 40:29that it's actually you know the work
  844. 40:31speed so I'm just going to add a
  845. 40:33humanoid to the workspace and I'm just
  846. 40:38going to check so I'm pretty sure it's
  847. 40:40called walk Speed without a capital S oh
  848. 40:43no it does have a capital s
  849. 40:47so walk speed with a capital s
  850. 40:51now we're gonna play the game and
  851. 40:53because I own that game pass I should be
  852. 40:54able to walk
  853. 40:56really fast
  854. 40:57so I own that game pass so I'm able to
  855. 40:59work to walk two times faster than other
  856. 41:01players now we need to make a two times
  857. 41:04coins Game Pass
  858. 41:07okay so I went ahead and created a brand
  859. 41:11new uh Game Pass and I called it two
  860. 41:14times coins so and I also got the ID and
  861. 41:17I put it on my notepad
  862. 41:20and I copied it so now what we need to
  863. 41:22do is check
  864. 41:25if MPS con user owns Game Pass async
  865. 41:29player.user ID and this time it's going
  866. 41:33to be uh the other game pass ID then
  867. 41:37what we need to do is uh
  868. 41:40player
  869. 41:42Dot
  870. 41:45coin multiplier where is it so I'm
  871. 41:48pretty sure we have a value
  872. 41:51okay so play adult values okay so we do
  873. 41:53not have that so I'm going to add a
  874. 41:58end value and it's going to be coin
  875. 42:01called coin multiplier
  876. 42:05and what we're gonna do is play the coin
  877. 42:08multiplier
  878. 42:12so player.coin multiplier.value is equal
  879. 42:15to two
  880. 42:16and by the way make sure that the
  881. 42:17default value is one
  882. 42:20okay so now what we need to do is enter
  883. 42:24our main server script and when we are
  884. 42:27awarding the player award on Destroy so
  885. 42:30we must already destroy when we do that
  886. 42:33what we need to do is the rewards should
  887. 42:35be metal around that divided by five and
  888. 42:38we are going to
  889. 42:40multiply it by
  890. 42:42by
  891. 42:44how much by the coin multiplier so
  892. 42:47player.values dot coin multiplier
  893. 42:52dot value
  894. 42:54and I think that this should work now
  895. 42:57all we need to do is just
  896. 43:01Okay so
  897. 43:03I need to enter my data save script and
  898. 43:06I'm going to uh reset my data store Key
  899. 43:09again
  900. 43:10I'm going to play the game and I should
  901. 43:12be able to
  902. 43:14get twice as much as many coins as I
  903. 43:16used to get so I'm going to multiply
  904. 43:18with one
  905. 43:19and I actually own the game pass so I'm
  906. 43:22gonna see what's wrong with this and
  907. 43:24coin multiplayer is not a valid member
  908. 43:25of players proc very easy to fix just
  909. 43:27change this to player dot values dot
  910. 43:31coin multiplier
  911. 43:33and now we can play the game
  912. 43:39okay so now I should of okay so values
  913. 43:43coin multiplier it should be two this
  914. 43:45time and I'm going to get a pet
  915. 43:51wait for it to hatch I got a dog now I'm
  916. 43:54gonna equip it
  917. 43:56I don't know why my game is lagging I
  918. 43:58think it's because I'm recording
  919. 44:01so now I'm going to play the game and
  920. 44:03send the pet and I should be able to get
  921. 44:05twice as many coins as I as I was
  922. 44:08supposed to get
  923. 44:09so I'm just going to wait for it to
  924. 44:11destroy
  925. 44:15foreign and let's see so I'm going to
  926. 44:18collect one
  927. 44:22and it gave me 40 coins
  928. 44:25so now as you can see I got 49 700 coins
  929. 44:29now with our coin multiplier was uh one
  930. 44:33which I'm going to do right now so value
  931. 44:35is coin multiplier
  932. 44:37and if it was one
  933. 44:39then
  934. 44:41we should only be able to get
  935. 44:45350 coins or something like that
  936. 44:48so I'm just going to wait for this to
  937. 44:50destroy
  938. 44:55and as you can see
  939. 44:58we only got 100 coins which is kind of
  940. 45:01weird
  941. 45:02actually I think it's because I
  942. 45:03destroyed a bigger coin drop
  943. 45:09Okay so
  944. 45:10what we need to do now is
  945. 45:13uh actually I think that's it for game
  946. 45:15passes
  947. 45:17okay so I think that's going to be it
  948. 45:19for today's tutorial if this helped
  949. 45:21Please Subscribe like the video share it
  950. 45:24with your friends and I'll see you all
  951. 45:25in 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 9 by polarisprog, generated from the public captions YouTube serves with the video. The transcript has 6,003 words across 951 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.