YouTube2Text

[NEW]How to make A Pet Simulator X Game on Roblox - Part 1 — Transcript

by polarisprog · 3,463 words · 519 segments · language en · Watch on YouTube

Full transcript

  1. 0:00hi everyone and welcome back to a new
  2. 0:02video so you guys might be confused by
  3. 0:04the title of this video and why it says
  4. 0:06part one well that's because I am
  5. 0:07redoing everything that I did in the old
  6. 0:10series but in a much better way and I
  7. 0:13also prepared everything before starting
  8. 0:14this new series so I'll not repeat the
  9. 0:16same mistakes and I'm also trying to
  10. 0:19make higher quality tutorials so the
  11. 0:21tutorials will be a lot better and this
  12. 0:23will all be done in a in four videos and
  13. 0:26here's a little clip of what we're going
  14. 0:28to be making
  15. 0:37thank you
  16. 0:54foreign
  17. 1:04also if you guys want to support me and
  18. 1:06want to have access to all of my project
  19. 1:07files including the one you're watching
  20. 1:09right now they will all be available on
  21. 1:11my patreon in Nintendo 2. that's the
  22. 1:14link will be in the description with
  23. 1:15that being said let's start
  24. 1:17all right so here I am in an empty base
  25. 1:20plate and what I'm gonna do is set up
  26. 1:22the project so I'm going to add a folder
  27. 1:25and it's going to be called uh Main
  28. 1:28okay I'm going to just call it main
  29. 1:31folder underscore workspace so main
  30. 1:33folder
  31. 1:34main folder underscore workspace
  32. 1:37and then I'm going to add another folder
  33. 1:39inside of it and I'm going to call it
  34. 1:41drops and I'm going to add another
  35. 1:43folder and this one is going to be
  36. 1:45called uh player pets
  37. 1:50make sure it's spelled exactly like I
  38. 1:52spelled it and then I'm going to create
  39. 1:55some drops so I'm just going to add a
  40. 1:57part anchor it and just change its brick
  41. 2:00color to maybe red and I'm going to in
  42. 2:04to right click and group it as model
  43. 2:08and then I'm going to rename it to Red
  44. 2:11drop
  45. 2:12and I'm just going to
  46. 2:15uh add a an end value inside of it and
  47. 2:19it's going to be called Max health
  48. 2:22and I'm going to set its Max Health to
  49. 2:25100 and duplicate this value by by right
  50. 2:28clicking and duplicate or you can just
  51. 2:30press Ctrl D and I'm going to rename Max
  52. 2:34Health to health
  53. 2:37and then I'm going to
  54. 2:39okay so I left a link
  55. 2:42to a model that I created and it's
  56. 2:45basically a billboard GUI that displays
  57. 2:48the job's health so just go ahead the
  58. 2:51link will be in the description press it
  59. 2:53press get and then you can open up the
  60. 2:55toolbox and go to my inventory or I mean
  61. 2:58my models and just get health display
  62. 3:01now when you get it it should be added
  63. 3:03to the workspace and just drag it inside
  64. 3:05of the red drop
  65. 3:07and you can customize it however you
  66. 3:09want you can maybe add a UI stroke to it
  67. 3:13give it a nice stroke make it
  68. 3:16maybe you can make it rounder with the Y
  69. 3:20corner
  70. 3:22or whatever you want to do with it it's
  71. 3:24just a bar
  72. 3:26a background and a text label now the
  73. 3:29next thing I'm going to do is duplicate
  74. 3:31this drop
  75. 3:32and let's just say the next drop will be
  76. 3:35a metal one so I'm just going to call it
  77. 3:37metal drop
  78. 3:40and I'm going to change this material to
  79. 3:42metal
  80. 3:44and I'm just going to make it
  81. 3:47Gray
  82. 3:49or okay just this color
  83. 3:52and I'm going to change the the max
  84. 3:56Health to 200 and this metal drop will
  85. 3:59be in another area which we don't have
  86. 4:01yet but you're going to have multiple
  87. 4:03areas in your game and this one will be
  88. 4:06in the second one you can make your drop
  89. 4:08look however you want it to be and then
  90. 4:11I'm just going to make sure that the
  91. 4:13primary part of both of these drops so
  92. 4:16just select the drop and go to primary
  93. 4:19part and just click part now the do the
  94. 4:23same thing for the other one so metal
  95. 4:25drop click primary part and click on the
  96. 4:28part
  97. 4:29now what I'm going to do is add a folder
  98. 4:32inside of the drops folder
  99. 4:34so it's a subfolder and I'm going to
  100. 4:36call it area one
  101. 4:40and I'm going to get my red parts and
  102. 4:42put it inside of the area one
  103. 4:44and I'm going to add another folder and
  104. 4:47it's going to be called area 2 area 2.
  105. 4:51and I'm going to get my metal drop and
  106. 4:53put it inside the area too now what I'm
  107. 4:57going to do is just put this right here
  108. 5:01maybe a little further
  109. 5:04all right so now we need some pets so
  110. 5:07what I'm gonna do is just so maybe you
  111. 5:10have your own pet model but I have these
  112. 5:14uh five beds right here made by Will
  113. 5:17Aussie one follow him on Twitter and
  114. 5:20I'm going to show you how to set up your
  115. 5:22pets now my pets right here are already
  116. 5:25grouped in a model
  117. 5:27but they are facing the right way to
  118. 5:29find out a decal to this as you can see
  119. 5:32the front surface is the front of the
  120. 5:34pet so the pet is looking directly
  121. 5:37at the front
  122. 5:39so if you're a pet if you add it and for
  123. 5:42example your decal will be on the on the
  124. 5:45left and it's actually the front
  125. 5:48what you're going to do is add a part to
  126. 5:50this to the dragon itself to the pad
  127. 5:52itself and just
  128. 5:55copy the size of your pet or maybe you
  129. 5:57can place this manually so just select
  130. 6:00it add the decal switching over the
  131. 6:02front surfaces and as you can see it's
  132. 6:04right there so I'm just going to rotate
  133. 6:06the part
  134. 6:08so just to rotate it
  135. 6:10I'm going to change this to 45 studs on
  136. 6:14the rotation and I'm just going to
  137. 6:16rotate this one like that and I'm going
  138. 6:18to cover the entire pad so just
  139. 6:23cover the pet
  140. 6:25with this part
  141. 6:36so just cover it correctly
  142. 6:40and what I'm going to do next is rename
  143. 6:42this Parts this part to primary
  144. 6:46and then I'm going to make sure that
  145. 6:47this primary part is transparent so
  146. 6:50transparency to one and the anchored
  147. 6:52property to true and they can't light
  148. 6:54properly to false and the dragon in the
  149. 6:57other parts
  150. 6:59for the other parts of your path just to
  151. 7:01make sure that they are also they are
  152. 7:03not anchored and they are not collidable
  153. 7:05but for the primary part make sure that
  154. 7:07it is anchored and that it's not
  155. 7:10collidable now what I'm gonna do is show
  156. 7:12you how to weld these together so just
  157. 7:15add the weld constraint to the primary
  158. 7:17part and press part 0 and set it to your
  159. 7:19primary and part one to the other part
  160. 7:23now if you have multiple Parts just
  161. 7:25duplicate this weld constraint and just
  162. 7:27press part one and set it to the other
  163. 7:29part I only have one part
  164. 7:32so one wealth constraint is enough now
  165. 7:35I'm going to select my pet model and I'm
  166. 7:37going to go to the primary part and
  167. 7:40set its primary part to the primary part
  168. 7:44all right so I'm going to go ahead and
  169. 7:46do this to all of my other pets and I'll
  170. 7:48be back
  171. 7:50all right so I just set up all of my
  172. 7:52pets so if your pet has wings and it
  173. 7:56flies so if your pet is supposed to fly
  174. 7:58don't do anything to it but if your pet
  175. 8:01is supposed to walk add a string value
  176. 8:03inside of it and rename it to walks
  177. 8:07and do the same thing for all the other
  178. 8:10pets that will look so just copy your
  179. 8:13walks value and right click on the dog
  180. 8:15and paste into
  181. 8:18same thing for the bunny right click
  182. 8:20paste into same thing for this right
  183. 8:22click paste into
  184. 8:24now what I'm going to do is add a folder
  185. 8:26inside of replicator storage and I'm
  186. 8:28going to call it pets
  187. 8:30and I'm going to add another folder and
  188. 8:32I'm going to call it remotes
  189. 8:34remote
  190. 8:36and I'm going to select all of my pets
  191. 8:38and drag them inside of the that's
  192. 8:42folder that we just created and also I
  193. 8:44think these bets are a little too big
  194. 8:46but we'll worry about that later
  195. 8:49now what I'm gonna do is okay so I made
  196. 8:52a model of a script you can get it in
  197. 8:55the description so again press get and
  198. 8:58then when you go to home toolbox you
  199. 9:01should see pet follower pets and Max
  200. 9:04series now just click it and if it says
  201. 9:07put forward includes one script just
  202. 9:11press ok
  203. 9:13and you're gonna drag this pet follower
  204. 9:15inside of storage gy
  205. 9:18or okay so it starts UI or maybe I would
  206. 9:22okay so I would rather put it inside of
  207. 9:24starter
  208. 9:26player Scripts
  209. 9:28and enter your pet follower and what I'm
  210. 9:31gonna do
  211. 9:32is okay so
  212. 9:36uh it's a bit complicated so I can't
  213. 9:38really explain what this does but
  214. 9:40basically just positions the paths
  215. 9:42around the character and lurps them and
  216. 9:46sets their C frames
  217. 9:47but what we're going to do is get this
  218. 9:50script put inside of star player scripts
  219. 9:52and now we're going to add a script
  220. 9:54inside of a server script service
  221. 9:58and this script is going to be called
  222. 10:01okay so script
  223. 10:03and it's going to be called server or
  224. 10:06Main
  225. 10:07server
  226. 10:09and what I'm going to do is add a older
  227. 10:14inside of this main server script and
  228. 10:16it's going to be called
  229. 10:18um
  230. 10:19uh player data
  231. 10:22and inside of this player data script
  232. 10:24I'm going to add a folder and it's going
  233. 10:25to be called
  234. 10:27maybe okay
  235. 10:29so I'm going to call it values
  236. 10:32and I'm going to add a
  237. 10:35object value inside of this and object's
  238. 10:37value and I'm going to call it
  239. 10:39sent to
  240. 10:41and then I'm going to okay so it's value
  241. 10:44set to nil make sure that it's an object
  242. 10:46value and what I'm going to do next is
  243. 10:49inside of the script I'm going to get
  244. 10:50the players service so local players is
  245. 10:53equal to game column get service players
  246. 10:54and then I'm going to do players.player
  247. 10:58added caller connect function player and
  248. 11:02then fillers Doppler added to comma
  249. 11:04connect function uh I mean players.play
  250. 11:07removing sorry
  251. 11:09come on connect function and that's also
  252. 11:12going to take the player now what I'm
  253. 11:14going to do is okay so we have both of
  254. 11:17these
  255. 11:19now I'm just okay so
  256. 11:22in here I'm going to create some
  257. 11:25variables so local local main folder
  258. 11:29underscore workspace is equal to
  259. 11:32workspace.me folder underscore workspace
  260. 11:35local player pets
  261. 11:38is equal to main folder underscore it's
  262. 11:40basically I've got I mean dot player
  263. 11:42pets and local drops is equal to main
  264. 11:46folder underscore workspace dot drops
  265. 11:50now what I'm going to do in here is
  266. 11:52whenever player joins we're going to
  267. 11:53create a brand new folder so local
  268. 11:55folder is equal to
  269. 11:57instance.new folder
  270. 12:00and I'm just going to do folder.name is
  271. 12:03equal to flare.name so we're going to
  272. 12:05create a new folder we're going to set
  273. 12:06its name to the player's name and
  274. 12:10folder.parent will be the player pets
  275. 12:13now that we've done that when the player
  276. 12:16leaves the game something very important
  277. 12:18that we need to do is check if there is
  278. 12:22a folder inside that's named his the
  279. 12:25player's name and it's inside the player
  280. 12:28pass folder so if player pads qualify
  281. 12:31first child player dot name then
  282. 12:35then what we're going to do is play our
  283. 12:37pets called the factors child's
  284. 12:39player.name called destroy
  285. 12:41and what we're going to do after that
  286. 12:44is Loop through for underscore come out
  287. 12:46V in pairs blurred in pairs
  288. 12:49script.player data can't get children
  289. 12:51into
  290. 12:53the dot name okay so I'm just going to
  291. 12:55the vehicle on clone dot parent is equal
  292. 12:58to and player
  293. 13:00so what we're doing here is whenever a
  294. 13:03player joins we created the folder that
  295. 13:04I talked about and we're gonna clone
  296. 13:07everything that's inside of these this
  297. 13:08player data folder and we're gonna put
  298. 13:11it inside of the inside of the player
  299. 13:13now I'm going to add a folder and I'm
  300. 13:15going to call it later stats so later
  301. 13:17stats
  302. 13:18leader stats and I'm going to add any
  303. 13:22value to it and it's going to be coins
  304. 13:26and I'm just going to set it to a
  305. 13:29thousand
  306. 13:30and then I'm going to play the game and
  307. 13:32see if the if what we did works so if
  308. 13:35you play the game right now
  309. 13:38and if I okay so I'm just going to go up
  310. 13:40to the workspace main okay so player
  311. 13:43pets and we see Polaris prog which is my
  312. 13:46username so we know that this works now
  313. 13:49what I'm going to do is show you what
  314. 13:51happens okay
  315. 13:53I'm going to show you and let me just
  316. 13:55try something real quick
  317. 13:58I'm going to just check something so
  318. 14:01okay
  319. 14:02now something I forgot to mention is
  320. 14:06inside of each pet you're going to have
  321. 14:08a an object value and it's going to be
  322. 14:11called attack
  323. 14:14I'll just copy this object value and
  324. 14:16paste it inside of all of the pads
  325. 14:22and now if you play the game
  326. 14:26and we go to replicator storage
  327. 14:30that's
  328. 14:31and I'm just going to get a random pet
  329. 14:33maybe a bunny and copy it and paste it
  330. 14:37inside of my player pass folder inside
  331. 14:40of Polaris prong as you can see it works
  332. 14:42and it works on the ground and if I
  333. 14:45duplicate it this is the cool part
  334. 14:48but we are not going to be covering in
  335. 14:51this series how to equip multiple paths
  336. 14:53but this is up to you maybe if you learn
  337. 14:55a bit more or maybe you can do it right
  338. 14:58now you can script an inventory that
  339. 15:02equips multiple pets
  340. 15:04but for now we're only going to have one
  341. 15:05and if I go ahead and select my pet and
  342. 15:09copy the and go to the attack value and
  343. 15:12click on it and go to the drops and area
  344. 15:15one and click on the red drop it will go
  345. 15:18there and start attacking it
  346. 15:20which is a cool thing now if I just set
  347. 15:22this to nil it will go back to my
  348. 15:24character
  349. 15:25now I'll show you how flying pets fly so
  350. 15:28if I just go ahead and get the dragon
  351. 15:30and just put it inside of Polaris prong
  352. 15:34as you can see it
  353. 15:36now works and the dragonflies
  354. 15:42okay so I'm going to stop the game and
  355. 15:44what I'm gonna do next
  356. 15:47okay so what I'm gonna do next is either
  357. 15:49click detector inside of all of my drops
  358. 15:52so and I click the texture
  359. 15:54and
  360. 15:55you can mess around with the max
  361. 15:57activation distance and the cursor icon
  362. 15:59but I'm not gonna do that I'm just going
  363. 16:01to add the click detector to both of
  364. 16:02these
  365. 16:04and I'm going to enter my main server
  366. 16:05script
  367. 16:07and what I'm going to do
  368. 16:09right here okay so I'm going to Loop
  369. 16:12through
  370. 16:13okay so for underscore comma drop drop
  371. 16:15in pairs workspace and there's drops
  372. 16:19drops go and get descendants
  373. 16:22do all we're going to do is check if
  374. 16:24drop column is a model
  375. 16:29no model
  376. 16:32then all right so if it is a model then
  377. 16:35what we're going to do is drop dot click
  378. 16:37detector dot mouse click on connect
  379. 16:42function layer and what we're going to
  380. 16:45do is we are just going to get the
  381. 16:48player pets so local player local
  382. 16:52okay so we already have a variable for
  383. 16:56that but what we're going to do is get
  384. 16:58the pets so just local okay maybe I can
  385. 17:00rename this to
  386. 17:03player underscore pets
  387. 17:09or maybe current wire pass
  388. 17:13is equal to a player pass
  389. 17:17dot uh of the square brackets
  390. 17:20player.name
  391. 17:22and we're gonna check
  392. 17:25if hashtag current player pets go and
  393. 17:29get children get children is greater
  394. 17:32than zero then
  395. 17:34what we're gonna do is get the pets so
  396. 17:37local pet is equal to and it's just
  397. 17:39going to be
  398. 17:41um
  399. 17:42current player pets gonna find first
  400. 17:46child of class
  401. 17:50model
  402. 17:52so I'm gonna get the first player with
  403. 17:54the first model that we see which is the
  404. 17:56pad that the player has equipped and
  405. 17:58what we're going to do is check okay so
  406. 18:01we're gonna check if
  407. 18:03player.values.cent2 is equal to nil then
  408. 18:07and if it is equal to nil then what
  409. 18:10we're going to do is just change the
  410. 18:13player's Center value to the drop and
  411. 18:16then we're going to do the pad okay so
  412. 18:19pet dot attack dot value when I set that
  413. 18:23to the player.values.cent2.value
  414. 18:27now the next thing we're going to do is
  415. 18:30okay so let me think about this okay so
  416. 18:34elsif
  417. 18:35so else if
  418. 18:38as if player.values Dot Center dot value
  419. 18:41is equal it comes with the drop then
  420. 18:42what we're going to do this time is do
  421. 18:46player.values dot center.value is equal
  422. 18:48to nil
  423. 18:51and the layer Dot and pet dot attack dot
  424. 18:54value is equal to Polar dot
  425. 18:56values.center.value now else if
  426. 18:59flare not values so okay so just put
  427. 19:03this in if there's values.center.value
  428. 19:06is not equal to nil and player dot
  429. 19:08without dot values dot sent to dot
  430. 19:11values not equal to the drop then what
  431. 19:14we're going to do is
  432. 19:17well uh
  433. 19:19player.values.center.value is equal to
  434. 19:20the drop and don't attack value is equal
  435. 19:23to
  436. 19:24player.values.cent2.value now if you
  437. 19:26play the game
  438. 19:30and just okay so if you play the game
  439. 19:36okay so I'm going to go to server View
  440. 19:39so just go to current client
  441. 19:43and we are in server View and what I'm
  442. 19:45going to do is go to the pets and I'm
  443. 19:49just going to get the dog maybe the fox
  444. 19:52and I'm going to paste it inside of the
  445. 19:54of uh my player object and now I have a
  446. 19:58fox and if I go ahead and click on one
  447. 20:00of these it should go there and start to
  448. 20:03thank them attacking them and if I press
  449. 20:05this it should go there and if I press
  450. 20:07this again it should come back to me
  451. 20:10now we know that this works and what I'm
  452. 20:12going to do is see if I can okay so
  453. 20:15first of all what I'm going to do is
  454. 20:17drop.max.health
  455. 20:21dot value is equal to drop.max health
  456. 20:25dot value
  457. 20:28and the next thing I'm going to do is
  458. 20:30add a script to starter player scripts
  459. 20:32and it's going to be called okay
  460. 20:36so I'm going to call it main client
  461. 20:40and inside of this main client script
  462. 20:42what I'm going to do is get get uh what
  463. 20:45did I just do
  464. 20:47anyways uh what I'm going to do is
  465. 20:52just task dot spawn function
  466. 20:55and what I'm going to do is while
  467. 20:59asks.weight so every one second
  468. 21:02do
  469. 21:03so every one second we're gonna check
  470. 21:05actually we're gonna need
  471. 21:07something else so local players it's
  472. 21:10equal to game point get service players
  473. 21:11and local player is equal to
  474. 21:14players.localplayer and I'm gonna check
  475. 21:17if player uh dot values dot sent to dot
  476. 21:21value uh is not equal to nil then and
  477. 21:25player.values
  478. 21:28dot sent to dot value
  479. 21:32DOT health dot value
  480. 21:35minus equal damage
  481. 21:40now this damage variable variable will
  482. 21:42be right here and the Damage Circle
  483. 21:44damage
  484. 21:45will be
  485. 21:47maybe one
  486. 21:50but instead of doing this what I'm going
  487. 21:52to do is just set okay so I'm going to
  488. 21:54set this to math.max
  489. 21:57and it will be from okay so player dot
  490. 22:01so just copy this paste it here
  491. 22:03minus and minus
  492. 22:09minus damage
  493. 22:11comma zero so what we're doing is just
  494. 22:14format what this does
  495. 22:15is basically just
  496. 22:18uh limit set to zero so we can't go so
  497. 22:21the health can be minus one remit and
  498. 22:24minus two so it can be a negative number
  499. 22:25and now if I play the game then this
  500. 22:28should be
  501. 22:30this should be working
  502. 22:31so I'm just going to go to server view
  503. 22:33go to paths I'm just going to pick the
  504. 22:36cat this time and drops or player pets
  505. 22:39and paste it inside the player object
  506. 22:43and if I go ahead and just select the
  507. 22:48drop right here
  508. 22:50and go to the health
  509. 22:53and press it it should go down every
  510. 22:56second by one okay so when it says zero
  511. 22:58it stays at zero and it doesn't go down
  512. 23:01even more but as you can see the pad is
  513. 23:04still attacking that but that's for the
  514. 23:05next episodes
  515. 23:09all right so this is going to be it for
  516. 23:11today's tutorial if this helped Please
  517. 23:13Subscribe like the video share it with
  518. 23:15your friends and I will see you all in
  519. 23:17the next video bye

About this transcript

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