How to make A Pet Simulator X Game on Roblox - Part 9 — Transcript
Full transcript
- 0:00everyone today I would like to announce
- 0:02that my patreon will now include maps
- 0:04and assets for every new series that I
- 0:06will start for this pet Simulator X
- 0:08Series my patreon now has all the
- 0:10scripts in the game this map that has
- 0:12three areas and this asset pack that
- 0:14includes all of these pests and answers
- 0:17that you see right here that will help
- 0:18you with your simulator if you guys are
- 0:20interested all of this is available on
- 0:22my patreon in kitten doll tier the link
- 0:25will be in the description and the
- 0:26pinned comment and by the way this map
- 0:28and all of these assets were made by
- 0:30wool Aussie follow him on Twitter at
- 0:32willowzy1
- 0:34okay so the first thing we need to do is
- 0:37make it so that whenever you click a
- 0:38drop this uh the health display
- 0:40billboard UI will be enabled and
- 0:43whenever you unsend your pet it will be
- 0:46disabled so what I have gone ahead and
- 0:49did is I select I typed in um Health
- 0:52display and I selected all of the health
- 0:55display Billboards and I made sure that
- 0:58enabled is unchecked and I'm going to go
- 1:01ahead and do the same thing for this one
- 1:04so just
- 1:05uncheck enabled and what I'm going to do
- 1:08is
- 1:10go to server script service main server
- 1:13enter the script and scroll all the way
- 1:15down to where we are looping through the
- 1:18drops and what I'm going to do is go to
- 1:19the remote folder and I'm going to add a
- 1:23remote event and I'm going to call it
- 1:26I'm going to call it
- 1:28um
- 1:29Trigger or toggle billboard
- 1:33now what I'm going to do is whenever we
- 1:36set the center value to the drop what
- 1:38I'm going to do is game the replicated
- 1:40storage dot remote stop trigger
- 1:44billboard.trigger billboard where is it
- 1:46oh it was toggle billboard gone fire
- 1:49client and that's going to take the
- 1:51player and the drop itself and it's also
- 1:54going to take whether or not we want it
- 1:57to be enabled or disabled but in this
- 2:00instance we want it to be enabled so
- 2:02true and I'm going to copy this line of
- 2:05code and whenever we are setting this to
- 2:07the drop we're going to paste that in
- 2:09and now we are going to paste it in here
- 2:12but what I'm going to do is this time
- 2:15it's going to be false
- 2:17and I'm going to enter the
- 2:22main client script and I'm going to
- 2:24scroll down and right here I'm going to
- 2:27type in remotes dot I guess the remote
- 2:31dot
- 2:32um I think it was toggled
- 2:34billboards.onclined event call invent
- 2:36function call connect function and
- 2:38that's going to take the drop and it's
- 2:41also going to take a Boolean so Boo
- 2:44and what we need to do is drop the
- 2:47health health display dot enabled
- 2:53is equal to and it's going to be the
- 2:56bull value so boom now what I'm going to
- 2:59do is copy this line of code and I'm
- 3:01going to do the same thing when we
- 3:03destroy the drop and respawn it so
- 3:05whenever we respawn it we need to set
- 3:07the enabled property of the health
- 3:09display to false
- 3:11now I'm going to play the game and see
- 3:13if this is going to work
- 3:16so I already hatched some pads so I have
- 3:19a cat right here so what I'm going to do
- 3:21is just send it here and as you can see
- 3:24it's now enabled
- 3:26and when it goes down
- 3:29actually I'm going to unsign the cat and
- 3:31now it's disabled and it's enabled again
- 3:35and when it destroys it should be
- 3:38enabled when disabled when it responds
- 3:40okay so we know that this works
- 3:43okay so now we need to display what
- 3:46paths are inside each egg so what I'm
- 3:48gonna do is Select my egg model or mesh
- 3:53and I'm going to press the plus icon and
- 3:55I'm going to create a billboard GUI and
- 4:00I'm going to set the size of this
- 4:01billboard gy so size to something like Z
- 4:05like uh maybe 20 comma zero comma 20
- 4:09comma zero
- 4:12and I'm going to
- 4:14okay so now I need to set its adorni to
- 4:18the egg itself and I'm going to add a
- 4:21frame to it now this Frame the size of
- 4:24this Frame is going to be
- 4:26um zero point uh three comma zero comma
- 4:310.5 or maybe zero point
- 4:34uh three comma zero
- 4:37and I'm going to position it actually
- 4:40I'm going to resize it so
- 4:43uh maybe 0.4
- 4:46actually that's a bit too big so 0.3
- 4:525
- 4:55or three four okay that's perfect so
- 4:58what I'm gonna do now is position it
- 5:00actually I'm going to set its Anchor
- 5:01Point to 0.5 and what I need to do now
- 5:05is set its position
- 5:07to 0.5 comma 0 comma 0.5 comma zero now
- 5:12it's in the middle and the mixture that
- 5:14always on top so where is always on top
- 5:17on the billboard gy not the frame is
- 5:19checked and now I'm going to mess around
- 5:22with the position of this Frame so
- 5:24position maybe zero point
- 5:27um
- 5:27two
- 5:30or 0.1
- 5:34and now we're gonna need to rescale the
- 5:37entire thing so size uh maybe
- 5:4130.
- 5:42and now we can scale down the frame so
- 5:46Point uh point
- 5:50two nine
- 5:53and position
- 5:550.2
- 5:57and size resize it down again so 0.23
- 6:03okay I think that this is perfect
- 6:06so what I'm gonna do is actually we need
- 6:08to position it a bit more uh down so 0.3
- 6:13or 0.25
- 6:15okay I think that this is
- 6:17this is the settings that we are gonna
- 6:19need and what I'm gonna do now is add a
- 6:22UI corner to it and I'm going to set its
- 6:26Corner radius to 0.1 comma 0 or
- 6:300.05 comma zero and what I'm going to do
- 6:33now is add a UI gradient to it so
- 6:36gradient
- 6:38and I'm going to set its rotation to 90
- 6:40degrees and I'm going to change its
- 6:43color to
- 6:45okay so color from a nice dark blue
- 6:51dark blue to a lighter blue
- 6:58okay I think that this is good enough
- 7:01for now or maybe we can just make it
- 7:03white
- 7:05so from from white to a dark gray
- 7:11or light gray
- 7:13and I think that looks good
- 7:15so what I'm gonna do next is I'm going
- 7:18to add a a
- 7:21UI grid layout to it and I'm going to
- 7:25add a text button or maybe a yeah a text
- 7:30button would be good
- 7:31I'm going to change its size
- 7:35so actually I'm going to change its
- 7:37color so just set its border size pixel
- 7:41to zero and I'm going to add a UI corner
- 7:45to it and I'm going to set the corner
- 7:46radius to 0.1 comma 0 and then or maybe
- 7:50okay that's good
- 7:52then I'm going to change the text to
- 7:54nothing
- 7:56and then I'm going to
- 7:59change the color so I'm going to add a
- 8:02UI gradient again
- 8:04and I'm going to make the color
- 8:07go from
- 8:08okay so maybe this time it's going to be
- 8:13from okay blue to a little bit of a
- 8:17darker blue or a lighter one
- 8:22okay I think that this
- 8:25I think that this is good enough so I'm
- 8:27going to rotate it again so 90 degrees
- 8:30and now what we need to do is select the
- 8:34UI grid layout and I'm going to change
- 8:37the fill Direction
- 8:40to actually it's called horizontal
- 8:42alignment to Center and the vertical
- 8:46alignment to Center
- 8:48now I'm going to change the size of my
- 8:52button so actually we need to do that
- 8:54from the Y grid layout so cell size uh
- 8:57offset zero offset zero on the Y and on
- 9:01the scale for the X it's gonna be Point
- 9:04uh 0.3
- 9:06or maybe okay 0.3 and for the Y I think
- 9:10it's going to be 0.2
- 9:12or 0.3 again on the actually Point okay
- 9:15so point two five on the Y
- 9:18or maybe
- 9:200.29 on the Y and point
- 9:240.4 on the actually point I think I
- 9:27think 0.3 was good
- 9:29so 0.2500 y
- 9:33and how many can we fill now
- 9:36okay that's good enough
- 9:38so we can have uh that many pets
- 9:42okay now what I'm gonna do is actually
- 9:45I'm gonna go to
- 9:47the UI grid layout again and I'm going
- 9:50to change the cell padding from scale to
- 9:53offset from offset to scale so I'm going
- 9:55to have multiple uh cells and I'm going
- 9:59to solve my y grid layout and I'm going
- 10:01to change the scale the offset to zero
- 10:05and the offset to zero on the set on the
- 10:07cell padding too and now we need to
- 10:10change the scale so I'm gonna have it at
- 10:14point
- 10:15zero five
- 10:17or point zero two and on the Y point
- 10:21zero zero point zero
- 10:26one or 0.02 okay that's perfect okay
- 10:31now I'm just going to get rid of most of
- 10:34these and I'm going to only leave one
- 10:37and I don't think that's the perfect
- 10:39square so I'm just going to go back to
- 10:42the size
- 10:44on the Y and I think this should be 0.26
- 10:49okay 0.26
- 10:52or
- 10:54okay now that's perfect
- 10:56now what I'm going to do is rename this
- 10:57to templates
- 11:01and I'm going to have a frame inside of
- 11:03it and the size of this Frame will be
- 11:06one comma zero comma one comma zero and
- 11:08the background transparency will be one
- 11:11and we need to rename this to viewport
- 11:14now what we need to do is Okay so we've
- 11:18done that now we need a text label to
- 11:21display the Rarity so size uh one comma
- 11:25zero comma
- 11:270.3 comma zero now I'm going to position
- 11:30it downwards so the position this will
- 11:33be a one or maybe a zero point uh 0.5
- 11:41or
- 11:430.6 or 7. okay seven is good now
- 11:47background transparency to one and I'm
- 11:49going to change the text scalp property
- 11:52to true and the text color three to a
- 11:56nice white and the text okay so the font
- 11:59should be for a Docker one
- 12:01so where is it
- 12:05for a doka one and the Okay so we've
- 12:09done that and we need to change the text
- 12:11to maybe 10 percent
- 12:14just for now just so that we can see how
- 12:16it will look and I think it looks pretty
- 12:18good
- 12:20uh maybe a bit bigger so the size of the
- 12:23text label point
- 12:25four
- 12:28but changing the size means that
- 12:30actually I'm just going to put it back I
- 12:32think that was just good enough
- 12:35okay so this will be a chance chance
- 12:38label
- 12:41and I'm just going to rename this to
- 12:44Mainframe
- 12:46and now I'm going to rename this to egg
- 12:49billboard
- 12:50[Music]
- 12:51now we can just cut this so right click
- 12:54and cut
- 12:57and I'm going to scroll down and inside
- 13:00of the X client I'm going to paste that
- 13:02in
- 13:04okay so what we need to do now
- 13:07is whenever the player joins
- 13:13hmm actually what I'm gonna do is cut
- 13:16this and put it inside all of the X by
- 13:18default
- 13:19so right click pasting to select it
- 13:23and uh the adorni make sure that this is
- 13:27just new
- 13:28so that each model is going to have its
- 13:31own billboard gy
- 13:34and I'm going to make sure that the
- 13:36template that we have inside of each one
- 13:39of them is invisible so just select all
- 13:42of your templates by holding down
- 13:44control and just to make sure that
- 13:46visible is unchecked
- 13:48okay now what I'm gonna do is and
- 13:52disable all these Billboards so enabled
- 13:54false
- 13:56okay so what we're gonna do is we're
- 13:59gonna have we're gonna enter our
- 14:02uh where's the X client script and what
- 14:06I'm gonna do is I'm going to have a
- 14:07function called open and close
- 14:10billboards
- 14:12[Music]
- 14:13and this will take the billboard
- 14:18and whether we want to open it or close
- 14:20it so I'm just going to call it Bool and
- 14:23what we're gonna do is uh if
- 14:27if a bull then
- 14:30and not is hatching
- 14:34then and what we're going to do is we're
- 14:36gonna have variable up here called is
- 14:38hatching
- 14:40and it's going to be set to false now
- 14:43what we need to do is else
- 14:47and I'm going to scroll down to whenever
- 14:49we hatch the egg and when we hatch it we
- 14:52need to set is hatching
- 14:54true and when we stop hatching is
- 14:57hatching will be false
- 15:00okay so now we're gonna go up here and
- 15:03whenever we do this we're gonna do
- 15:05billboard to enabled
- 15:07and enabled enabled is equal to true and
- 15:11then we need to have a twin so between
- 15:14is equal to Twin service command create
- 15:17and that's going to take the billboard
- 15:19itself and then twin info between info
- 15:24dot new and it's going to be 0.2 uh
- 15:28comma nm.easant style DOT sign maybe uh
- 15:32comma in them is in Direction dot out
- 15:35and then we're gonna set its size so
- 15:39comma uh curly brackets size is equal to
- 15:43and when we open it so where is it so a
- 15:48ball
- 15:49uh I'm pretty sure we set the size okay
- 15:52so use them to use them to Dot from
- 15:55scale so we have the X to 20.
- 15:59this will depend on what your billboard
- 16:01size is uh come up and 30.
- 16:06and now we need to play this win so drop
- 16:09a line and twin column play now we're
- 16:12going to copy all of this paste it right
- 16:14here and we're gonna set this to false
- 16:17actually it's still going to be true but
- 16:20okay so I'm gonna close it
- 16:23and then when we play the tween we need
- 16:26to change its size this time to from
- 16:28using two Dot from scale 0 comma zero
- 16:33and then we need to weigh it 0.2 seconds
- 16:36so that's the way 0.2 seconds and then
- 16:40when this twin is completed then we will
- 16:43well uh billboard dot enabled
- 16:48uh is equal to false
- 16:50but I think what I'm gonna do is instead
- 16:52of using tween task that always 0.2
- 16:55we're going to do tween
- 16:57between dot completed column weights
- 17:01[Music]
- 17:03and in here we need to change this to
- 17:050.1 because I think it will look better
- 17:09okay so what we need to do now is uh
- 17:13figure out when we should call this
- 17:14function so I think I know how to do
- 17:17that I'm going to go down here and run
- 17:20service dot heartbeat Corner connect
- 17:22function
- 17:24and what I'm going to do is I'm going to
- 17:25Loop through every single leg so for
- 17:27underscore comma egg in pears eggs come
- 17:32get children do if egg cone is a base
- 17:37part then
- 17:39what we need to do is local character
- 17:43do we have the character
- 17:45no so local character so what we're
- 17:48doing is looking through every single
- 17:49egg and uh
- 17:52you can get the character so player
- 17:54called character or player dot character
- 17:57added calling ways and we're gonna check
- 17:59if the character is there so if
- 18:01character then so the character is there
- 18:04then what we need to do is check if the
- 18:07distance between the character and the
- 18:10egg is less than 15 studs so if
- 18:14brackets and the character
- 18:18dot primary part so the humanoid
- 18:21parts
- 18:23dot position
- 18:26uh minus
- 18:28egg dot position
- 18:31dot magnitude make sure to stop your dot
- 18:34magnitude outside of the bracket so dot
- 18:36magnitude
- 18:37is less or equal to 15 studs then what
- 18:42we're going to do is open or close
- 18:44Billboards and it's going to take the uh
- 18:48egg
- 18:49dot egg billboard
- 18:53comma true so we're going to open it
- 18:56else uh open the workload and close
- 18:59Billboards but this time it's going to
- 19:01be false
- 19:04okay so this should work so I'm gonna go
- 19:06ahead and try this out
- 19:08for myself so play the game
- 19:11I'm going to view the output to make
- 19:12sure that everything works
- 19:15and when I get close to an egg it should
- 19:17pop that up and it should close but I
- 19:20think that the closing is way too fast
- 19:22so I'm going to go back here and make
- 19:25sure that it's set to 0.2
- 19:31and now I'm going to play the game and
- 19:33see if this is any better
- 19:37so when we get close to it it should pop
- 19:41it up and yeah that's way too fast
- 19:45and what we need to do is whenever we we
- 19:48wait for the twin to be completed we're
- 19:50gonna faster weight 0.4 seconds again
- 19:55so I think this should fix that uh
- 19:58flickering glitch that we have
- 20:05okay this is a lot smoother but 0.2 is
- 20:08way too much
- 20:10so 0.1
- 20:12and now this is going to look a lot
- 20:15better
- 20:18okay so yep as you can see this is a lot
- 20:22smoother
- 20:23and it looks really good
- 20:25okay that's that's good now what I'm
- 20:28gonna do is make sure that the proximity
- 20:30prompt so proximity prompt I'm gonna
- 20:33make sure that it's uh that the distance
- 20:35is 15 so same as the uh
- 20:39um
- 20:40billboard so make sure that the max
- 20:42activation distance is 15 on all of them
- 20:45and what we need to do is make it so
- 20:48that the uh so that it displays the
- 20:51price of the egg itself
- 20:54so to do that it's very simple all we
- 20:56need to do is
- 20:58enter our main client script
- 21:01or actually we have okay so enter X
- 21:04server
- 21:06and what we need to do when we live
- 21:07through the X
- 21:10okay so we're gonna require a module so
- 21:12local
- 21:14um format format module
- 21:17is equal to uh require replicator stores
- 21:21dot format number out
- 21:24and what I'm gonna do is
- 21:28um Okay so
- 21:32proximity prompt okay so egg
- 21:35dot proximity prompt
- 21:40uh I think it was it wasn't action text
- 21:43what was it
- 21:46I think it's called okay so it's okay
- 21:50where is it so action text is open but
- 21:53I'm pretty sure there was another thing
- 21:55object text yes
- 21:57so what I'm going to do is uh the action
- 22:00text first so action text is equal to a
- 22:04number
- 22:05alt so
- 22:08format number
- 22:10format number dot format Compact and
- 22:12that's going to take the X price so
- 22:17hmm
- 22:18when I put these outside of here
- 22:23and it's going to be a price
- 22:29and then egg dot objects text
- 22:34the object text will be open
- 22:39now this should look pretty good and I'm
- 22:42gonna see if our eggs will still work
- 22:45after this
- 22:47so I'm gonna play the game and it should
- 22:49display the price of each egg
- 22:53and it only says open so that does not
- 22:55work
- 22:56so object text is not a valid number of
- 22:58uh
- 23:00when your egg oh
- 23:02it was egged or proximity
- 23:05prompt proximity
- 23:08prompt
- 23:10now this should hopefully work
- 23:17and as you can see it says 500 and open
- 23:21and this one is 1.5 K and this one is
- 23:243.5 k
- 23:26so that does work now what we need to do
- 23:29is just clone templates so let's do that
- 23:33by just going to
- 23:36where is it so
- 23:38I'm going to enter
- 23:41my
- 23:43okay where is it uh okay so I think I
- 23:47know how to do this I'm going to enter X
- 23:49clients
- 23:51and when we are looping through the eggs
- 23:55are we even looking 3DX
- 23:59okay so we are not looping through the
- 24:01eggs so I'm gonna do that right here
- 24:05so for underscore comma V in comma egg
- 24:09in Paris X call and get children dude if
- 24:13egg cone is a base part
- 24:19then so if the egg is a base part then
- 24:23what we should do is get the all the
- 24:27eggs pets so I think we are doing that
- 24:30here
- 24:32okay so we are not doing that
- 24:34okay data is equal to require
- 24:38egg dot egg data I think
- 24:41our data
- 24:43what was it oh did I just delete
- 24:45something
- 24:46yeah I did
- 24:48okay I want to go back so we have a
- 24:52module called Data so data so we're
- 24:55going to require this and local pets is
- 24:58equal to okay so local egg pets not pets
- 25:02is equal to egg data
- 25:05pets
- 25:07let's enter the egg data thing and as
- 25:11you can see we have egg pets not pets so
- 25:18and what we need to do is Loop through
- 25:21the egg pads so
- 25:23for underscore comma pet in pairs egg
- 25:27pets do
- 25:30let's see the way we are doing that from
- 25:32X server so we just
- 25:35okay so pet stable
- 25:40okay that's simple enough
- 25:42we're gonna work with that
- 25:45so we are just getting the patch table
- 25:48okay so pet
- 25:51okay so print pet we're just gonna print
- 25:55pet dot uh pet name
- 25:58we're gonna see what that returns
- 26:04so it should give us nil okay so it gave
- 26:07us nil so we're gonna see how to fix
- 26:08that
- 26:10okay so I fixed it all I had to do is
- 26:12print that square back as pet name so
- 26:15what I'm gonna do is
- 26:19a local template
- 26:21is equal to uh egg dot billboard dot uh
- 26:26egg billboard sorry
- 26:28egg billboard dot template
- 26:33colon clone
- 26:35uh and when we clone it so template dot
- 26:39name is equal chip hat square brackets
- 26:42uh pet name so pet name
- 26:48and then we need to get the actual pet
- 26:50model so pit model is equal to that's a
- 26:54common finds first child path square
- 26:56brackets pet name
- 27:02and then template.parent is equal to egg
- 27:06dot egg Bill board
- 27:09and what I'm gonna do is
- 27:13um I'm going to go up here
- 27:17to this so create template
- 27:22and I'm just going to copy this
- 27:24I'm going to copy this entire code
- 27:27and by the way this is what I just
- 27:29copied
- 27:30create a template just copy this
- 27:32and scroll down here and just paste that
- 27:35in and templates can be template this
- 27:38time or new maybe new template
- 27:41new templates
- 27:43so just change this to new template
- 27:45sorry
- 27:46so a new templates go and wait for that
- 27:48and we are just going to change this to
- 27:51pets model
- 27:55and this should work so now what I'm
- 27:57going to do is just task the weight
- 28:00uh three two seconds before doing this
- 28:03so when I play the game now and we're
- 28:05gonna see if this works
- 28:07that's a two seconds one two
- 28:10we have nothing so template is not a
- 28:14valid number of egg billboard okay
- 28:16that's very simple to fix
- 28:18uh it's egg billboard dot Mainframe
- 28:23dark template and also we need to make
- 28:26sure that new template.visible is equal
- 28:28to true
- 28:30now this is gonna work
- 28:32Maybe
- 28:39okay so it did work but it did not
- 28:41parent them correctly
- 28:44so we need to pause the game and when we
- 28:46parent it should be the Mainframe
- 28:49and we also need to do one more thing
- 28:52which is uh change the
- 28:56hmm okay actually this is gonna work
- 29:01let's see
- 29:03so when I go here as you can see it did
- 29:06do this but it does not display anything
- 29:09and that's I think this is simple to fix
- 29:12I think what's causing this is like I'm
- 29:16gonna go to the main folder workspace X
- 29:19basic tag
- 29:21uh egg billboards
- 29:24cat
- 29:26I'm just going to go to viewport and I'm
- 29:28going to change the Z index to 2.
- 29:303
- 29:32okay so this does not work
- 29:36and I think I know why whenever you
- 29:38whenever you are doing this I think you
- 29:40should clone the uh
- 29:42oh
- 29:44okay okay let's fix this uh we have to
- 29:47create a folder inside of star G1 it's
- 29:49going to be called egg Bill boards
- 29:54foreign
- 29:57[Music]
- 29:58we are looking through all the egg build
- 30:01boards I'm going to do we're gonna do
- 30:02egg
- 30:04billboard
- 30:06okay so local build board or maybe
- 30:09okay so called billboard is equal to egg
- 30:12dot egg billboard
- 30:16and we're gonna build billboard.parent
- 30:18is equal to player gy
- 30:21flower gy so we need a reference to
- 30:23player gy
- 30:26okay so local player gy
- 30:32is equal to and player come away for
- 30:35child to lower gy
- 30:38now we're gonna go down here
- 30:41and player
- 30:44gy
- 30:45dot parent is equal to player gy and
- 30:48when we parent it to player gy
- 30:52um we just need to Billboards okay so
- 30:54billboard Dorney
- 30:56is equal to egg
- 30:59nothing this should work this time
- 31:05so I'm gonna wait two seconds and we
- 31:07have a problem
- 31:08uh open and close this is not
- 31:12okay this is not good
- 31:14but I think it's easy to fix all we need
- 31:16to do is instead of looking through the
- 31:18eggs we need to be looping through the
- 31:21billboard so so for underscore command
- 31:23billboards
- 31:24in pairs all this so if this coin is a
- 31:28Billboards DUI let's just do what I'm
- 31:31doing so change this to billboard change
- 31:34this to billboard and now this is going
- 31:37to be eggdol position
- 31:41so billboard don't adorney stop position
- 31:46dot magnitude
- 31:48okay
- 31:50this should work
- 31:55okay so no errors actually error
- 31:59uh exotic billboard oh same thing again
- 32:02so just change this to billboard dot
- 32:05Mainframe calling clone and change this
- 32:07to billboard dot Mainframe
- 32:10and now you can play the game and now
- 32:13this is gonna work
- 32:17uh
- 32:18okay nothing works I'm gonna work on
- 32:21fixing this and I'll be back
- 32:24okay so I fixed everything and all I had
- 32:27to do was change okay so in the
- 32:29heartbeat what I did was change in pairs
- 32:32to uh
- 32:34okay so I did player gy dot egg
- 32:36Billboards come and get children instead
- 32:38of X call and get children and I also
- 32:41what else did I did did I do so uh yeah
- 32:45I'll change this to billboard.position
- 32:48and then down here what I did is parent
- 32:51this to player gy direct Billboards so
- 32:54egg billboard.parents is equal to player
- 32:55gyn.ex Billboards not player gy and now
- 32:59everything works fine
- 33:03so if you play the game now
- 33:06after a bit of seconds as you can see
- 33:08this works but we need to show the
- 33:12Rarities
- 33:13or the chances of getting each pet so we
- 33:16just need to change this
- 33:19okay so that's
- 33:21actually new template dot text Dot uh
- 33:25chance label chance label dot text is
- 33:29equal to and it's going to be act data
- 33:33don't and I think or actually it's gonna
- 33:35be a pad square brackets
- 33:39and I think it was chance
- 33:46and now this should work
- 33:50but what I forgot to do is also uh dot
- 33:53dot percentage sign so don't don't
- 33:56percentage sign
- 33:59and if you play the game now then this
- 34:01should work
- 34:10so as you can see now it does show the
- 34:12percentages and everything works fine
- 34:16okay so now I need to make it so that
- 34:19whenever you
- 34:20uh so that you can't hatch your neck if
- 34:23you don't have the area where the egg is
- 34:25in so
- 34:27what I'm gonna do is just
- 34:31where is it so
- 34:33I'm going to have a
- 34:37a string values inside of each egg or
- 34:41actually just go inside of the data
- 34:44data script itself and do egg
- 34:49egg area and this one is going to be
- 34:52area zero
- 34:54because it's the basic gag
- 34:56and make sure to add to add the combo
- 34:59now I'm going to do this for all of them
- 35:01so the stone egg for me is area two
- 35:05and the winter egg
- 35:10is area one
- 35:15and now this should work
- 35:18now we also need to enter our X server
- 35:22and whenever we
- 35:24press this what we need to do is just
- 35:26check if
- 35:28[Music]
- 35:30player dot coin uh
- 35:33areas.valid.com finds first child
- 35:38fights with child egg
- 35:41data so uh egg area
- 35:46then
- 35:48we're gonna do all of this
- 35:53so now if I do not own the area I should
- 35:57not be able to buy the egg
- 35:59so I do own this area so I should be
- 36:02able to hatch this egg
- 36:07but okay so something is wrong with the
- 36:10egg hatching so I need to fix this so
- 36:12pet model is equal to pets confines with
- 36:14child chosen pet dog pet name
- 36:16okay
- 36:18so the reason why uh the eggs are not
- 36:21working anymore is because a model
- 36:23should be uh this cone clone
- 36:27by the way this is on the uh
- 36:29Loop through the eggs on the client
- 36:33and now we should be able to Hash the
- 36:34EXO now I should be able to hatch this
- 36:37one
- 36:39but I should not be able to Hash the
- 36:41winter rag
- 36:42as you can see I can't and I can't hatch
- 36:45this one too
- 36:47so this works so what we need to do now
- 36:49is
- 36:51game passes
- 36:53okay so here I am in the euroblox
- 36:55website and what I'm gonna do is show
- 36:57you how to create a game pass so go to
- 36:59the create tab on Roblox
- 37:02click on it and then go to your
- 37:05experience or game and then go to store
- 37:09and press add pass
- 37:13now we're gonna press choose file and
- 37:16just choose an image you can't see what
- 37:17I'm doing but it's going to prompt up
- 37:19the file explorer if you have a Windows
- 37:21PC and just just choose a random image
- 37:25I'm just going to try to find one
- 37:28and okay so I'm going to choose one real
- 37:30quick
- 37:34okay so I chose my profile picture and
- 37:37now you are going to uh type in your
- 37:41game pass name so for me it's times to
- 37:43walk speed
- 37:46times two speed
- 37:50and you're gonna give it a description
- 37:51so for me it's just going to be doubles
- 37:55your
- 37:57walk speed
- 37:59your walking speed
- 38:02okay so then you hit preview
- 38:04then wait for it and verify upload
- 38:10now you can go to configure
- 38:13so press the uh
- 38:15Cog wheel and just press configure and
- 38:17go to sales and item for sale and give
- 38:20it a price so for me it's going to be
- 38:21one Roblox and just press save and go to
- 38:24details
- 38:25Now You're Gonna Want to Get Your Game
- 38:27Pass ID so to do that I'm going to show
- 38:29you how to do that right now
- 38:31so your game pass ID is this string of
- 38:35numbers that are right here so just
- 38:37double click on the numbers select them
- 38:40from the link right click and press copy
- 38:42now you can save those numbers numbers
- 38:45somewhere so for me it's just going to
- 38:47be my notepad
- 38:50okay so now we need to go to Roblox
- 38:53studio and what I'm going to do is enter
- 38:55my I'm going to create a new script
- 38:57actually and I'm going to call it a
- 38:59Marketplace
- 39:02and I'm going to get Marketplace service
- 39:04so local MPS is equal to Gamecock
- 39:06Service Marketplace service and local
- 39:09players is equal to game come on get
- 39:13service get service players and what we
- 39:17need to do is players.player added
- 39:19command connect function and it's we're
- 39:22going to take the player
- 39:24and what we're going to do is if
- 39:31connect function and that's going to
- 39:34take the character
- 39:36and we need to check
- 39:39if
- 39:41Marketplace service call new user owns
- 39:43Game Pass async and we're gonna take the
- 39:48player's user ID so player.user ID comma
- 39:50and The Game Pass ID so times work speed
- 39:54is this ID
- 39:56so type in your game pass ID that you
- 39:58just got and then what we're gonna do is
- 40:02just print
- 40:05players.name
- 40:06dot dot
- 40:08has
- 40:10two times walk speed
- 40:14and then we just we are just going to do
- 40:17character dot humanoid
- 40:20dot walk speed
- 40:22Hulk speed is equal to and 32 instead of
- 40:2716 so I'm just going to double check
- 40:29that it's actually you know the work
- 40:31speed so I'm just going to add a
- 40:33humanoid to the workspace and I'm just
- 40:38going to check so I'm pretty sure it's
- 40:40called walk Speed without a capital S oh
- 40:43no it does have a capital s
- 40:47so walk speed with a capital s
- 40:51now we're gonna play the game and
- 40:53because I own that game pass I should be
- 40:54able to walk
- 40:56really fast
- 40:57so I own that game pass so I'm able to
- 40:59work to walk two times faster than other
- 41:01players now we need to make a two times
- 41:04coins Game Pass
- 41:07okay so I went ahead and created a brand
- 41:11new uh Game Pass and I called it two
- 41:14times coins so and I also got the ID and
- 41:17I put it on my notepad
- 41:20and I copied it so now what we need to
- 41:22do is check
- 41:25if MPS con user owns Game Pass async
- 41:29player.user ID and this time it's going
- 41:33to be uh the other game pass ID then
- 41:37what we need to do is uh
- 41:40player
- 41:42Dot
- 41:45coin multiplier where is it so I'm
- 41:48pretty sure we have a value
- 41:51okay so play adult values okay so we do
- 41:53not have that so I'm going to add a
- 41:58end value and it's going to be coin
- 42:01called coin multiplier
- 42:05and what we're gonna do is play the coin
- 42:08multiplier
- 42:12so player.coin multiplier.value is equal
- 42:15to two
- 42:16and by the way make sure that the
- 42:17default value is one
- 42:20okay so now what we need to do is enter
- 42:24our main server script and when we are
- 42:27awarding the player award on Destroy so
- 42:30we must already destroy when we do that
- 42:33what we need to do is the rewards should
- 42:35be metal around that divided by five and
- 42:38we are going to
- 42:40multiply it by
- 42:42by
- 42:44how much by the coin multiplier so
- 42:47player.values dot coin multiplier
- 42:52dot value
- 42:54and I think that this should work now
- 42:57all we need to do is just
- 43:01Okay so
- 43:03I need to enter my data save script and
- 43:06I'm going to uh reset my data store Key
- 43:09again
- 43:10I'm going to play the game and I should
- 43:12be able to
- 43:14get twice as much as many coins as I
- 43:16used to get so I'm going to multiply
- 43:18with one
- 43:19and I actually own the game pass so I'm
- 43:22gonna see what's wrong with this and
- 43:24coin multiplayer is not a valid member
- 43:25of players proc very easy to fix just
- 43:27change this to player dot values dot
- 43:31coin multiplier
- 43:33and now we can play the game
- 43:39okay so now I should of okay so values
- 43:43coin multiplier it should be two this
- 43:45time and I'm going to get a pet
- 43:51wait for it to hatch I got a dog now I'm
- 43:54gonna equip it
- 43:56I don't know why my game is lagging I
- 43:58think it's because I'm recording
- 44:01so now I'm going to play the game and
- 44:03send the pet and I should be able to get
- 44:05twice as many coins as I as I was
- 44:08supposed to get
- 44:09so I'm just going to wait for it to
- 44:11destroy
- 44:15foreign and let's see so I'm going to
- 44:18collect one
- 44:22and it gave me 40 coins
- 44:25so now as you can see I got 49 700 coins
- 44:29now with our coin multiplier was uh one
- 44:33which I'm going to do right now so value
- 44:35is coin multiplier
- 44:37and if it was one
- 44:39then
- 44:41we should only be able to get
- 44:45350 coins or something like that
- 44:48so I'm just going to wait for this to
- 44:50destroy
- 44:55and as you can see
- 44:58we only got 100 coins which is kind of
- 45:01weird
- 45:02actually I think it's because I
- 45:03destroyed a bigger coin drop
- 45:09Okay so
- 45:10what we need to do now is
- 45:13uh actually I think that's it for game
- 45:15passes
- 45:17okay so I think that's going to be it
- 45:19for today's tutorial if this helped
- 45:21Please Subscribe like the video share it
- 45:24with your friends and I'll see you all
- 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.