How to make A Pet Simulator X Game on Roblox - Part 8 — Transcript
Full transcript
- 0:00hi everyone and welcome back to a new
- 0:02video on the how to make a bit similar X
- 0:04star game series in this video what
- 0:06we're going to be doing is covering how
- 0:08to save your equipped pet so when you
- 0:11leave and rejoin the game your patch
- 0:13should be equipped automatically and how
- 0:17to make different paths deal different
- 0:19amounts of damage so each path has his
- 0:21own damage value
- 0:23and also we're going to be fixing the uh
- 0:27data saving script
- 0:30also if you guys want to support me and
- 0:32want to have access to all of the
- 0:33project files including the one you're
- 0:35watching right now they will all be
- 0:36available on my patreon in Nintendo tier
- 0:40okay so the first thing we're gonna do
- 0:42is fix the data store so what I'm going
- 0:45to do is enter my data safe script and
- 0:47I'm going to scroll down to the load
- 0:48data function now what I realized is the
- 0:51bug of the value multiplying happens
- 0:54when you have a value a default value
- 0:57inside of the folders so to fix that
- 1:00it's very simple I'm gonna get rid of
- 1:02this so just delete this and remove this
- 1:05else right here and this end right here
- 1:08and what I'm going to do is check if
- 1:10it's a default value so just if okay so
- 1:15if player data which is this
- 1:17uh the the folder that contains all the
- 1:20default folders and values so if player
- 1:23data can't find first child to string I
- 1:25so the name of the current folders that
- 1:27will we are looking through uh common
- 1:30find first child uh C square brackets
- 1:33one so the name of the value
- 1:35then then what we're gonna do then this
- 1:37is a default value so value is equal to
- 1:41a player confined to his child by the
- 1:44way now changes to play not player data
- 1:46so player will find first child to
- 1:49string I
- 1:50qualified for his child
- 1:53C square brackets one okay else
- 1:58just copy this
- 2:00and paste it there
- 2:03and this should work so go up here and
- 2:07reset your data store so my data key
- 2:11maybe uh
- 2:13just a random number
- 2:16and I'm gonna play the game and see if
- 2:19this works
- 2:20so I'm just going to hatch an egg
- 2:24and okay so I hatched an egg and I got a
- 2:28cat and what I'm gonna do is just equip
- 2:31one
- 2:33and I'm gonna see this is gonna work so
- 2:35I'm gonna send this
- 2:37okay so it works now I'm Gonna Leave the
- 2:40game and rejoin and this should
- 2:43hopefully work
- 2:45[Music]
- 2:46so I should have only okay so coins gems
- 2:50that's good and values okay so we have
- 2:53the cat and we still have area zero so
- 2:57we know that this works
- 2:59okay so what we're gonna do now is make
- 3:02each pet deal a certain amount of damage
- 3:04so what I'm gonna do is go to the best
- 3:07that I have so I have the cat and the
- 3:09one I'm gonna do is go to the to the
- 3:12plus icon and I'm just going to add a
- 3:14number value to the model and I'm going
- 3:16to call it uh damage
- 3:20and I'm going to set it to three
- 3:23or maybe 30.
- 3:25and what I'm going to do is add a value
- 3:28inside of the values folder and it's
- 3:30going to be a number value and it's
- 3:32going to be named damage
- 3:35is going to be set to a default value
- 3:37actually just zero sorry and what I'm
- 3:40going to do is enter my main server
- 3:42script now what we need to do is
- 3:44whenever we equip a pad okay so where is
- 3:47it uh so uh
- 3:49okay so remove the liquid pattern on
- 3:51Service events so whenever we equip a
- 3:53pet what we need to do is set the
- 3:56players damage value so player
- 3:58dot values
- 4:00stop damage
- 4:02dot value
- 4:04is equal to and we're going to set it to
- 4:08fit model
- 4:10damage dot value and this should work
- 4:13and when we unequip it what we need to
- 4:15do is set it back to zero so
- 4:18layer dot values dot damage the value is
- 4:20equal to zero
- 4:21now what we need to do is enter our uh
- 4:25that follower actually it's a main
- 4:27client script and what we're going to do
- 4:29is down here when we deal the damage
- 4:30what we need to do is just change this
- 4:33to player dot values Dot and where is it
- 4:37so dot damage
- 4:39not value and this should work so what
- 4:42I'm going to do now is play the game and
- 4:43see if this does anything
- 4:46so our damage value should be 30 so I'm
- 4:49going to play the game
- 4:51um got a pet actually I have one saved
- 4:53so I'm just gonna play and get this path
- 4:56let's check so player pads Polaris prong
- 4:59the cast damage value of 30 and I'm
- 5:01going to try to damage a drop
- 5:03and shoot them okay so it applies okay
- 5:05so it's 30 so it works so we know that
- 5:08this works
- 5:10and I'm going to double check by just
- 5:13changing the damage value
- 5:16to okay where is it
- 5:18where is it
- 5:21uh okay damage I'm going to change this
- 5:23to uh 10 and I'm gonna see if this works
- 5:26so just play the game
- 5:28and
- 5:32wait for this to load get the card send
- 5:35it and now it should deal 10 damage so
- 5:38we know that this works
- 5:40okay so now we need to check if this
- 5:42will save so I'm going to leave the game
- 5:44because we don't want this to save
- 5:47Play It Again
- 5:49[Music]
- 5:51and it should not save
- 5:54okay so it does not say which is a good
- 5:56thing
- 5:58okay now what we need to do is save the
- 6:00currently equipped pad
- 6:03so what I'm going to do is just go here
- 6:05to the values folder and I'm going to
- 6:07add a not a string value
- 6:12and I'm going to rename it
- 6:14to
- 6:15something like uh equipped
- 6:20pet
- 6:21and the value will be nothing or maybe
- 6:23it will be just none
- 6:26and what I'm going to do is go to okay
- 6:29where is it I'm going to go to my main
- 6:33server script and whenever we equip the
- 6:35pet what we need to do is player the
- 6:38values dot equipped pets
- 6:42thought value
- 6:43is equal to and we're going to set set
- 6:46it to the pet model's name so pet model
- 6:48dot name or just a bit name
- 6:50that name
- 6:51now what we need to do is
- 6:55we're going to do the same thing here
- 6:56when we unequiv the path but we're going
- 6:58to set it to none again
- 6:59[Music]
- 7:01okay so now when we
- 7:03play the game going deep when a new
- 7:05player is added what we need to do is
- 7:08have a character added event so player
- 7:11got character added go and connect come
- 7:14on connect
- 7:15character added to go on connect
- 7:17function that's going to take the
- 7:19character
- 7:19and I'm just going to copy this paste it
- 7:23here
- 7:24and I'm going to change this to two
- 7:27seconds
- 7:28so just paste that in here and what I'm
- 7:31going to do when a new player is added
- 7:32is just equip the pest that that we have
- 7:37that we had equipped
- 7:40so to do that we just we are just going
- 7:43to where is it so we need to do this
- 7:48but we also need to do the same thing on
- 7:50the client so
- 7:51what I'm going to do is check if
- 7:54if player dot values not equipped
- 7:59at dot value is not equal to none so
- 8:03it's not equal to none
- 8:05then what we're going to do is just well
- 8:08do this
- 8:09where is it
- 8:11so we need to call this remote
- 8:14so what I'm going to do is call it from
- 8:16the client
- 8:18uh so I'm going to add a remote event
- 8:21and I'm going to I'm just going to
- 8:23duplicate the remote event that I have
- 8:25and I'm going to rename this one to
- 8:27equip
- 8:30saved saved
- 8:33pet and I'm going to call it so remote
- 8:38game.replicator stores dot remote dot
- 8:41equip saved dot equip saved pet confirm
- 8:45client and that's going to take the
- 8:47player and the layer dot values dot
- 8:51equipped
- 8:52at dot value
- 8:55now what I'm going to do is go back to
- 8:57the client so main client script and I
- 9:01really hope I have that in here but I
- 9:04don't so I'm going to go to the X client
- 9:06I think it's here okay
- 9:09so
- 9:10what I'm gonna do in here
- 9:12is whenever that is cold okay so remotes
- 9:17call and wait for child go and wait for
- 9:19child uh equip saved Pat Donald Cline
- 9:24event gonna connect function and that's
- 9:27just going to take the uh pet name
- 9:32also this okay
- 9:34so when this happens what we need to do
- 9:38is okay let me think
- 9:41equip the pet
- 9:45okay so what I did is whenever this is
- 9:49called we are calling the on template
- 9:51clicked uh function and we are just
- 9:54sending scrolling frame confines result
- 9:56name I'm going to lower this number
- 9:58right here
- 9:59and
- 10:01what I'm gonna do is go back to the
- 10:04server and instead of doing this I'm
- 10:06going to wait about
- 10:09um
- 10:09maybe something like 10 seconds or eight
- 10:14then do this
- 10:16and I'm gonna see if this works and also
- 10:19we have to go to the values folder and
- 10:22make sure that save children values and
- 10:24save children is is such a truth of the
- 10:28attributes should be set to true
- 10:30and also we also need to
- 10:34okay so this should work now what I'm
- 10:37going to do is have a an attribute
- 10:39inside of the values that I do not want
- 10:41to save so I'm going to add an attribute
- 10:43and I'm going to okay so you can't see
- 10:46what I'm doing but what I did is press
- 10:49the add attribute button and when it
- 10:52asks me for the type I press the string
- 10:55and I said and I entered the name do not
- 11:00save value and I said it and I saved it
- 11:04and now I should have an attribute
- 11:07now we do not want to save the damage
- 11:10value and we also don't want to save the
- 11:13center value so same thing and attribute
- 11:15do not
- 11:18save
- 11:19a value
- 11:23okay so this should work now what I'm
- 11:25going to do is go to my saved data
- 11:27function on the data save script and
- 11:30where is it so do not save value if not
- 11:33child go and get attribute do not save
- 11:35value oh
- 11:37yeah I I just realized that we already
- 11:40scripted that
- 11:42so I'm just gonna play the game and see
- 11:44if this is gonna work
- 11:50okay so when we play the game this
- 11:52should of course be none
- 11:55so where is it values equipped but this
- 11:58should be none
- 12:00and I'm just going to go ahead and equip
- 12:02this and as you can see now it says cat
- 12:04now I'm Gonna Leave the game while
- 12:06having the cut equipped and when I play
- 12:09the game I should
- 12:11it should save
- 12:14hopefully so values uh
- 12:17uh damage did not save okay good now uh
- 12:21equip pet and it does save that and as
- 12:25you can see my pet will be equipped
- 12:26after a bit of time now the other thing
- 12:28that we need to do is instead of just
- 12:31where is it okay so instead of just okay
- 12:33where is the X client so instead of just
- 12:36doing this after waiting two seconds we
- 12:38need to do this when a remote is cold so
- 12:40I'm going to duplicate the remote event
- 12:42again and I'm going to call it load
- 12:44saved pets and what I'm gonna do is
- 12:48remote going away for child load save to
- 12:51pads the oncline event come on connect
- 12:53function pet name actually no
- 12:57that's all we're gonna do now I'm just
- 13:00going to paste that in
- 13:02so load safety bets uh they're good now
- 13:06what I'm gonna just go back to my main
- 13:08server script I'm sorry if this gets
- 13:10confusing
- 13:11okay so character added we're gonna wait
- 13:13two seconds and we're gonna get rid of
- 13:14this and we are also before we do this
- 13:16we're gonna call the sorry game the
- 13:19replicator storage dot remotes dot load
- 13:23fire client and that's just going to
- 13:26take the player
- 13:27now I'm going to get rid of these empty
- 13:29spaces because we don't need them and
- 13:32I'm going to play the game now and
- 13:34hopefully this will work so after my
- 13:37character is loaded after a bit of time
- 13:40it should load everything and it did
- 13:42which is great
- 13:44okay so now we saved the equipped pad
- 13:48and it should also change okay so we did
- 13:51change our damage value which is great
- 13:54and now we have this working okay so
- 13:59that's gonna be it for today's tutorial
- 14:00if this helped Please Subscribe like the
- 14:03video share it with your friends and
- 14:04I'll see you all in the next video bye
About this transcript
This page contains the full transcript of How to make A Pet Simulator X Game on Roblox - Part 8 by polarisprog, generated from the public captions YouTube serves with the video. The transcript has 2,198 words across 327 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.