[NEW]How to make A Pet Simulator X Game on Roblox - Part 1 — Transcript
Full transcript
- 0:00hi everyone and welcome back to a new
- 0:02video so you guys might be confused by
- 0:04the title of this video and why it says
- 0:06part one well that's because I am
- 0:07redoing everything that I did in the old
- 0:10series but in a much better way and I
- 0:13also prepared everything before starting
- 0:14this new series so I'll not repeat the
- 0:16same mistakes and I'm also trying to
- 0:19make higher quality tutorials so the
- 0:21tutorials will be a lot better and this
- 0:23will all be done in a in four videos and
- 0:26here's a little clip of what we're going
- 0:28to be making
- 0:37thank you
- 0:54foreign
- 1:04also if you guys want to support me and
- 1:06want to have access to all of my project
- 1:07files including the one you're watching
- 1:09right now they will all be available on
- 1:11my patreon in Nintendo 2. that's the
- 1:14link will be in the description with
- 1:15that being said let's start
- 1:17all right so here I am in an empty base
- 1:20plate and what I'm gonna do is set up
- 1:22the project so I'm going to add a folder
- 1:25and it's going to be called uh Main
- 1:28okay I'm going to just call it main
- 1:31folder underscore workspace so main
- 1:33folder
- 1:34main folder underscore workspace
- 1:37and then I'm going to add another folder
- 1:39inside of it and I'm going to call it
- 1:41drops and I'm going to add another
- 1:43folder and this one is going to be
- 1:45called uh player pets
- 1:50make sure it's spelled exactly like I
- 1:52spelled it and then I'm going to create
- 1:55some drops so I'm just going to add a
- 1:57part anchor it and just change its brick
- 2:00color to maybe red and I'm going to in
- 2:04to right click and group it as model
- 2:08and then I'm going to rename it to Red
- 2:11drop
- 2:12and I'm just going to
- 2:15uh add a an end value inside of it and
- 2:19it's going to be called Max health
- 2:22and I'm going to set its Max Health to
- 2:25100 and duplicate this value by by right
- 2:28clicking and duplicate or you can just
- 2:30press Ctrl D and I'm going to rename Max
- 2:34Health to health
- 2:37and then I'm going to
- 2:39okay so I left a link
- 2:42to a model that I created and it's
- 2:45basically a billboard GUI that displays
- 2:48the job's health so just go ahead the
- 2:51link will be in the description press it
- 2:53press get and then you can open up the
- 2:55toolbox and go to my inventory or I mean
- 2:58my models and just get health display
- 3:01now when you get it it should be added
- 3:03to the workspace and just drag it inside
- 3:05of the red drop
- 3:07and you can customize it however you
- 3:09want you can maybe add a UI stroke to it
- 3:13give it a nice stroke make it
- 3:16maybe you can make it rounder with the Y
- 3:20corner
- 3:22or whatever you want to do with it it's
- 3:24just a bar
- 3:26a background and a text label now the
- 3:29next thing I'm going to do is duplicate
- 3:31this drop
- 3:32and let's just say the next drop will be
- 3:35a metal one so I'm just going to call it
- 3:37metal drop
- 3:40and I'm going to change this material to
- 3:42metal
- 3:44and I'm just going to make it
- 3:47Gray
- 3:49or okay just this color
- 3:52and I'm going to change the the max
- 3:56Health to 200 and this metal drop will
- 3:59be in another area which we don't have
- 4:01yet but you're going to have multiple
- 4:03areas in your game and this one will be
- 4:06in the second one you can make your drop
- 4:08look however you want it to be and then
- 4:11I'm just going to make sure that the
- 4:13primary part of both of these drops so
- 4:16just select the drop and go to primary
- 4:19part and just click part now the do the
- 4:23same thing for the other one so metal
- 4:25drop click primary part and click on the
- 4:28part
- 4:29now what I'm going to do is add a folder
- 4:32inside of the drops folder
- 4:34so it's a subfolder and I'm going to
- 4:36call it area one
- 4:40and I'm going to get my red parts and
- 4:42put it inside of the area one
- 4:44and I'm going to add another folder and
- 4:47it's going to be called area 2 area 2.
- 4:51and I'm going to get my metal drop and
- 4:53put it inside the area too now what I'm
- 4:57going to do is just put this right here
- 5:01maybe a little further
- 5:04all right so now we need some pets so
- 5:07what I'm gonna do is just so maybe you
- 5:10have your own pet model but I have these
- 5:14uh five beds right here made by Will
- 5:17Aussie one follow him on Twitter and
- 5:20I'm going to show you how to set up your
- 5:22pets now my pets right here are already
- 5:25grouped in a model
- 5:27but they are facing the right way to
- 5:29find out a decal to this as you can see
- 5:32the front surface is the front of the
- 5:34pet so the pet is looking directly
- 5:37at the front
- 5:39so if you're a pet if you add it and for
- 5:42example your decal will be on the on the
- 5:45left and it's actually the front
- 5:48what you're going to do is add a part to
- 5:50this to the dragon itself to the pad
- 5:52itself and just
- 5:55copy the size of your pet or maybe you
- 5:57can place this manually so just select
- 6:00it add the decal switching over the
- 6:02front surfaces and as you can see it's
- 6:04right there so I'm just going to rotate
- 6:06the part
- 6:08so just to rotate it
- 6:10I'm going to change this to 45 studs on
- 6:14the rotation and I'm just going to
- 6:16rotate this one like that and I'm going
- 6:18to cover the entire pad so just
- 6:23cover the pet
- 6:25with this part
- 6:36so just cover it correctly
- 6:40and what I'm going to do next is rename
- 6:42this Parts this part to primary
- 6:46and then I'm going to make sure that
- 6:47this primary part is transparent so
- 6:50transparency to one and the anchored
- 6:52property to true and they can't light
- 6:54properly to false and the dragon in the
- 6:57other parts
- 6:59for the other parts of your path just to
- 7:01make sure that they are also they are
- 7:03not anchored and they are not collidable
- 7:05but for the primary part make sure that
- 7:07it is anchored and that it's not
- 7:10collidable now what I'm gonna do is show
- 7:12you how to weld these together so just
- 7:15add the weld constraint to the primary
- 7:17part and press part 0 and set it to your
- 7:19primary and part one to the other part
- 7:23now if you have multiple Parts just
- 7:25duplicate this weld constraint and just
- 7:27press part one and set it to the other
- 7:29part I only have one part
- 7:32so one wealth constraint is enough now
- 7:35I'm going to select my pet model and I'm
- 7:37going to go to the primary part and
- 7:40set its primary part to the primary part
- 7:44all right so I'm going to go ahead and
- 7:46do this to all of my other pets and I'll
- 7:48be back
- 7:50all right so I just set up all of my
- 7:52pets so if your pet has wings and it
- 7:56flies so if your pet is supposed to fly
- 7:58don't do anything to it but if your pet
- 8:01is supposed to walk add a string value
- 8:03inside of it and rename it to walks
- 8:07and do the same thing for all the other
- 8:10pets that will look so just copy your
- 8:13walks value and right click on the dog
- 8:15and paste into
- 8:18same thing for the bunny right click
- 8:20paste into same thing for this right
- 8:22click paste into
- 8:24now what I'm going to do is add a folder
- 8:26inside of replicator storage and I'm
- 8:28going to call it pets
- 8:30and I'm going to add another folder and
- 8:32I'm going to call it remotes
- 8:34remote
- 8:36and I'm going to select all of my pets
- 8:38and drag them inside of the that's
- 8:42folder that we just created and also I
- 8:44think these bets are a little too big
- 8:46but we'll worry about that later
- 8:49now what I'm gonna do is okay so I made
- 8:52a model of a script you can get it in
- 8:55the description so again press get and
- 8:58then when you go to home toolbox you
- 9:01should see pet follower pets and Max
- 9:04series now just click it and if it says
- 9:07put forward includes one script just
- 9:11press ok
- 9:13and you're gonna drag this pet follower
- 9:15inside of storage gy
- 9:18or okay so it starts UI or maybe I would
- 9:22okay so I would rather put it inside of
- 9:24starter
- 9:26player Scripts
- 9:28and enter your pet follower and what I'm
- 9:31gonna do
- 9:32is okay so
- 9:36uh it's a bit complicated so I can't
- 9:38really explain what this does but
- 9:40basically just positions the paths
- 9:42around the character and lurps them and
- 9:46sets their C frames
- 9:47but what we're going to do is get this
- 9:50script put inside of star player scripts
- 9:52and now we're going to add a script
- 9:54inside of a server script service
- 9:58and this script is going to be called
- 10:01okay so script
- 10:03and it's going to be called server or
- 10:06Main
- 10:07server
- 10:09and what I'm going to do is add a older
- 10:14inside of this main server script and
- 10:16it's going to be called
- 10:18um
- 10:19uh player data
- 10:22and inside of this player data script
- 10:24I'm going to add a folder and it's going
- 10:25to be called
- 10:27maybe okay
- 10:29so I'm going to call it values
- 10:32and I'm going to add a
- 10:35object value inside of this and object's
- 10:37value and I'm going to call it
- 10:39sent to
- 10:41and then I'm going to okay so it's value
- 10:44set to nil make sure that it's an object
- 10:46value and what I'm going to do next is
- 10:49inside of the script I'm going to get
- 10:50the players service so local players is
- 10:53equal to game column get service players
- 10:54and then I'm going to do players.player
- 10:58added caller connect function player and
- 11:02then fillers Doppler added to comma
- 11:04connect function uh I mean players.play
- 11:07removing sorry
- 11:09come on connect function and that's also
- 11:12going to take the player now what I'm
- 11:14going to do is okay so we have both of
- 11:17these
- 11:19now I'm just okay so
- 11:22in here I'm going to create some
- 11:25variables so local local main folder
- 11:29underscore workspace is equal to
- 11:32workspace.me folder underscore workspace
- 11:35local player pets
- 11:38is equal to main folder underscore it's
- 11:40basically I've got I mean dot player
- 11:42pets and local drops is equal to main
- 11:46folder underscore workspace dot drops
- 11:50now what I'm going to do in here is
- 11:52whenever player joins we're going to
- 11:53create a brand new folder so local
- 11:55folder is equal to
- 11:57instance.new folder
- 12:00and I'm just going to do folder.name is
- 12:03equal to flare.name so we're going to
- 12:05create a new folder we're going to set
- 12:06its name to the player's name and
- 12:10folder.parent will be the player pets
- 12:13now that we've done that when the player
- 12:16leaves the game something very important
- 12:18that we need to do is check if there is
- 12:22a folder inside that's named his the
- 12:25player's name and it's inside the player
- 12:28pass folder so if player pads qualify
- 12:31first child player dot name then
- 12:35then what we're going to do is play our
- 12:37pets called the factors child's
- 12:39player.name called destroy
- 12:41and what we're going to do after that
- 12:44is Loop through for underscore come out
- 12:46V in pairs blurred in pairs
- 12:49script.player data can't get children
- 12:51into
- 12:53the dot name okay so I'm just going to
- 12:55the vehicle on clone dot parent is equal
- 12:58to and player
- 13:00so what we're doing here is whenever a
- 13:03player joins we created the folder that
- 13:04I talked about and we're gonna clone
- 13:07everything that's inside of these this
- 13:08player data folder and we're gonna put
- 13:11it inside of the inside of the player
- 13:13now I'm going to add a folder and I'm
- 13:15going to call it later stats so later
- 13:17stats
- 13:18leader stats and I'm going to add any
- 13:22value to it and it's going to be coins
- 13:26and I'm just going to set it to a
- 13:29thousand
- 13:30and then I'm going to play the game and
- 13:32see if the if what we did works so if
- 13:35you play the game right now
- 13:38and if I okay so I'm just going to go up
- 13:40to the workspace main okay so player
- 13:43pets and we see Polaris prog which is my
- 13:46username so we know that this works now
- 13:49what I'm going to do is show you what
- 13:51happens okay
- 13:53I'm going to show you and let me just
- 13:55try something real quick
- 13:58I'm going to just check something so
- 14:01okay
- 14:02now something I forgot to mention is
- 14:06inside of each pet you're going to have
- 14:08a an object value and it's going to be
- 14:11called attack
- 14:14I'll just copy this object value and
- 14:16paste it inside of all of the pads
- 14:22and now if you play the game
- 14:26and we go to replicator storage
- 14:30that's
- 14:31and I'm just going to get a random pet
- 14:33maybe a bunny and copy it and paste it
- 14:37inside of my player pass folder inside
- 14:40of Polaris prong as you can see it works
- 14:42and it works on the ground and if I
- 14:45duplicate it this is the cool part
- 14:48but we are not going to be covering in
- 14:51this series how to equip multiple paths
- 14:53but this is up to you maybe if you learn
- 14:55a bit more or maybe you can do it right
- 14:58now you can script an inventory that
- 15:02equips multiple pets
- 15:04but for now we're only going to have one
- 15:05and if I go ahead and select my pet and
- 15:09copy the and go to the attack value and
- 15:12click on it and go to the drops and area
- 15:15one and click on the red drop it will go
- 15:18there and start attacking it
- 15:20which is a cool thing now if I just set
- 15:22this to nil it will go back to my
- 15:24character
- 15:25now I'll show you how flying pets fly so
- 15:28if I just go ahead and get the dragon
- 15:30and just put it inside of Polaris prong
- 15:34as you can see it
- 15:36now works and the dragonflies
- 15:42okay so I'm going to stop the game and
- 15:44what I'm gonna do next
- 15:47okay so what I'm gonna do next is either
- 15:49click detector inside of all of my drops
- 15:52so and I click the texture
- 15:54and
- 15:55you can mess around with the max
- 15:57activation distance and the cursor icon
- 15:59but I'm not gonna do that I'm just going
- 16:01to add the click detector to both of
- 16:02these
- 16:04and I'm going to enter my main server
- 16:05script
- 16:07and what I'm going to do
- 16:09right here okay so I'm going to Loop
- 16:12through
- 16:13okay so for underscore comma drop drop
- 16:15in pairs workspace and there's drops
- 16:19drops go and get descendants
- 16:22do all we're going to do is check if
- 16:24drop column is a model
- 16:29no model
- 16:32then all right so if it is a model then
- 16:35what we're going to do is drop dot click
- 16:37detector dot mouse click on connect
- 16:42function layer and what we're going to
- 16:45do is we are just going to get the
- 16:48player pets so local player local
- 16:52okay so we already have a variable for
- 16:56that but what we're going to do is get
- 16:58the pets so just local okay maybe I can
- 17:00rename this to
- 17:03player underscore pets
- 17:09or maybe current wire pass
- 17:13is equal to a player pass
- 17:17dot uh of the square brackets
- 17:20player.name
- 17:22and we're gonna check
- 17:25if hashtag current player pets go and
- 17:29get children get children is greater
- 17:32than zero then
- 17:34what we're gonna do is get the pets so
- 17:37local pet is equal to and it's just
- 17:39going to be
- 17:41um
- 17:42current player pets gonna find first
- 17:46child of class
- 17:50model
- 17:52so I'm gonna get the first player with
- 17:54the first model that we see which is the
- 17:56pad that the player has equipped and
- 17:58what we're going to do is check okay so
- 18:01we're gonna check if
- 18:03player.values.cent2 is equal to nil then
- 18:07and if it is equal to nil then what
- 18:10we're going to do is just change the
- 18:13player's Center value to the drop and
- 18:16then we're going to do the pad okay so
- 18:19pet dot attack dot value when I set that
- 18:23to the player.values.cent2.value
- 18:27now the next thing we're going to do is
- 18:30okay so let me think about this okay so
- 18:34elsif
- 18:35so else if
- 18:38as if player.values Dot Center dot value
- 18:41is equal it comes with the drop then
- 18:42what we're going to do this time is do
- 18:46player.values dot center.value is equal
- 18:48to nil
- 18:51and the layer Dot and pet dot attack dot
- 18:54value is equal to Polar dot
- 18:56values.center.value now else if
- 18:59flare not values so okay so just put
- 19:03this in if there's values.center.value
- 19:06is not equal to nil and player dot
- 19:08without dot values dot sent to dot
- 19:11values not equal to the drop then what
- 19:14we're going to do is
- 19:17well uh
- 19:19player.values.center.value is equal to
- 19:20the drop and don't attack value is equal
- 19:23to
- 19:24player.values.cent2.value now if you
- 19:26play the game
- 19:30and just okay so if you play the game
- 19:36okay so I'm going to go to server View
- 19:39so just go to current client
- 19:43and we are in server View and what I'm
- 19:45going to do is go to the pets and I'm
- 19:49just going to get the dog maybe the fox
- 19:52and I'm going to paste it inside of the
- 19:54of uh my player object and now I have a
- 19:58fox and if I go ahead and click on one
- 20:00of these it should go there and start to
- 20:03thank them attacking them and if I press
- 20:05this it should go there and if I press
- 20:07this again it should come back to me
- 20:10now we know that this works and what I'm
- 20:12going to do is see if I can okay so
- 20:15first of all what I'm going to do is
- 20:17drop.max.health
- 20:21dot value is equal to drop.max health
- 20:25dot value
- 20:28and the next thing I'm going to do is
- 20:30add a script to starter player scripts
- 20:32and it's going to be called okay
- 20:36so I'm going to call it main client
- 20:40and inside of this main client script
- 20:42what I'm going to do is get get uh what
- 20:45did I just do
- 20:47anyways uh what I'm going to do is
- 20:52just task dot spawn function
- 20:55and what I'm going to do is while
- 20:59asks.weight so every one second
- 21:02do
- 21:03so every one second we're gonna check
- 21:05actually we're gonna need
- 21:07something else so local players it's
- 21:10equal to game point get service players
- 21:11and local player is equal to
- 21:14players.localplayer and I'm gonna check
- 21:17if player uh dot values dot sent to dot
- 21:21value uh is not equal to nil then and
- 21:25player.values
- 21:28dot sent to dot value
- 21:32DOT health dot value
- 21:35minus equal damage
- 21:40now this damage variable variable will
- 21:42be right here and the Damage Circle
- 21:44damage
- 21:45will be
- 21:47maybe one
- 21:50but instead of doing this what I'm going
- 21:52to do is just set okay so I'm going to
- 21:54set this to math.max
- 21:57and it will be from okay so player dot
- 22:01so just copy this paste it here
- 22:03minus and minus
- 22:09minus damage
- 22:11comma zero so what we're doing is just
- 22:14format what this does
- 22:15is basically just
- 22:18uh limit set to zero so we can't go so
- 22:21the health can be minus one remit and
- 22:24minus two so it can be a negative number
- 22:25and now if I play the game then this
- 22:28should be
- 22:30this should be working
- 22:31so I'm just going to go to server view
- 22:33go to paths I'm just going to pick the
- 22:36cat this time and drops or player pets
- 22:39and paste it inside the player object
- 22:43and if I go ahead and just select the
- 22:48drop right here
- 22:50and go to the health
- 22:53and press it it should go down every
- 22:56second by one okay so when it says zero
- 22:58it stays at zero and it doesn't go down
- 23:01even more but as you can see the pad is
- 23:04still attacking that but that's for the
- 23:05next episodes
- 23:09all right so this is going to be it for
- 23:11today's tutorial if this helped Please
- 23:13Subscribe like the video share it with
- 23:15your friends and I will see you all in
- 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.