How to make A Pet Simulator X Game on Roblox - Part 7 — Transcript
Full transcript
- 0:00hello everyone and welcome back to a new
- 0:02tutorial on the how to make a person
- 0:04letter X Style game series in this video
- 0:06I'm going to be showing you how to make
- 0:08a data how to fix the data saving system
- 0:10and also we are going to be making a
- 0:13system for dropping coins when you
- 0:15destroy a certain drop and you can also
- 0:18collect those coins and it will award
- 0:21the player
- 0:23also if you guys want to support me and
- 0:25want to have access to all of the
- 0:27project files including the one you're
- 0:28watching right now that will all be
- 0:30available on my patreon edit and all
- 0:32tier
- 0:34okay so what we're going to start with
- 0:36is fixing the leader stats bug so as you
- 0:40can see right now I have two values
- 0:42inside of my leader stats folder but if
- 0:44I leave the game and rejoin
- 0:48I'll have four
- 0:51so I'll check these and as you can see I
- 0:54have two coins values and two gem values
- 0:57so I'm gonna I'm gonna go ahead and try
- 0:59to fix that so just scroll down here and
- 1:03what I'm gonna do is check if
- 1:06if if true string I is equal equal so
- 1:10it's choosing I is equal equal to liter
- 1:12stats then what we're going to do is
- 1:15um local leader stats
- 1:17is equal to and what I'm going to do is
- 1:20set this to
- 1:23um okay so player dot leader stats
- 1:27then we need to get to set this value
- 1:31variable up here so value is equal to
- 1:33and I'm just going to set it to leader
- 1:36stats square brackets uh to C square
- 1:40brackets one
- 1:42else else we can copy all of this so
- 1:46Ctrl X to cut and paste it here
- 1:49now that should work
- 1:51but the first thing you're going to need
- 1:52to do is reset your data store key so
- 1:54I'm just going to change this to my data
- 1:5721 and I'm going to play the game
- 2:03and see if this works
- 2:06so I have two liter SAS values and I'm
- 2:08going to go here and open an egg so that
- 2:12I have less coins and now I'm going to
- 2:14leave the game
- 2:16rejoin
- 2:21and as you can see I should I should
- 2:24still have my pet and I have uh two
- 2:28values inside of the layer stats folder
- 2:31now what I'm gonna do is make the player
- 2:33rewarding system so if you destroy drop
- 2:37it should drop coins so the first thing
- 2:40we're gonna do is add a folder inside of
- 2:42the main folder underscore workspace and
- 2:44I'm just going to rename it to coin or
- 2:48maybe currency drops
- 2:51currency drops
- 2:53and what I'm gonna do
- 2:55and what I'm gonna do is just go to
- 2:58the workspace and I'm going to add a
- 3:00block and I'm going to change its size
- 3:02to one comma one comma one
- 3:06and then I'm going to make sure that
- 3:08it's transparent so transparency is
- 3:11equal to one and I'm going to add a
- 3:13billboard gy and I'm going to check
- 3:15always on top
- 3:17and I'm also going to change its size to
- 3:191 comma zero comma one comma zero
- 3:22or maybe 1.5 comma 0 comma 1.5 comma
- 3:26zero and this should work
- 3:30now what I'm going to just add a an
- 3:32image label to this
- 3:34and I'm going to change its size to 1.
- 3:38comma zero comma one comma zero and then
- 3:41I'm going to change its image so I'm
- 3:43going to go to the toolbox and I'm just
- 3:45going to pick a random coin image maybe
- 3:47I'll see if I have one inside of my
- 3:51uh toolbox okay so I have
- 3:55okay I don't have any
- 3:58coin images that I can use I'm just
- 4:00going to look for a coin in the toolbox
- 4:04and I think I'm going to choose this one
- 4:08okay I'm gonna use this one and I'm just
- 4:11going to check to paste in the image
- 4:15so right click and copy asset ID and
- 4:19just paste it there
- 4:20and now I'm going to make the background
- 4:22transparency one
- 4:24and yeah that's going to be our coin
- 4:26drop and make sure that that Anchorage
- 4:28is unchecked so anchor it's unchecked
- 4:30and can Collide true
- 4:32now I'm going to rename this to coin
- 4:34drop
- 4:35and what I'm gonna do is put it inside
- 4:38of the of replicator storage for now
- 4:42actually I'm gonna add a folder and I'm
- 4:44going to call it assets
- 4:47and I'm just going to add a
- 4:51folder called
- 4:53currencies currency drops
- 4:57and I'm just going to drag the coin drop
- 4:59there
- 5:00and now what I'm going to do is go to
- 5:03start player uh start player script and
- 5:06I'm going to add a module script this
- 5:08module script will be called currency
- 5:11dropper
- 5:13so currency
- 5:16dropper
- 5:20and what I'm gonna do is okay so I'm
- 5:24going to have a function in here
- 5:25function module
- 5:27dot drop
- 5:28uh coins or maybe drop currency
- 5:32and that's going to take the object that
- 5:35that we want to drop so object comma and
- 5:38the amount of objects that we want to
- 5:41drop and the C frame like the original C
- 5:44form that we want this to spawn from and
- 5:46so a list of of IDs so I'm just going to
- 5:49type in gyds I'll I'll show you what a
- 5:53gygi is later but for now I'll just do
- 5:56this so this is just a table of ideas
- 5:58that we're gonna get
- 6:00and then we're going to Loop through
- 6:01from so for I is equal to from one to
- 6:05the amount
- 6:06do and task.spawn function and what I'm
- 6:10going to do local drop is equal to and
- 6:13object called clone
- 6:17and drop the parent is equal to
- 6:21workspace dot main folder underscore
- 6:23workspace or currency drops
- 6:25and local ID is equal to
- 6:29instance.new and string value ID dot
- 6:33value
- 6:35is equal to
- 6:37gyds now as I said this is a table so
- 6:39we're going to get the index so square
- 6:42brackets I
- 6:43and
- 6:45id.name is equal to
- 6:49ID
- 6:51and IG dot parent is equal to drop
- 6:55and then what I'm going to do is get the
- 6:57angle so local angle is equal to I
- 7:00multiplied by and brackets math dot Pi
- 7:03so math dot pi multiplied by 2 to get
- 7:07the uh full circle and we're going to
- 7:11divide the whole thing by the amount of
- 7:13drops that we're going to get so we're
- 7:14gonna get a certain
- 7:16angle for each drop
- 7:19uh on the radius of the circle and local
- 7:22X is equal to
- 7:24math.cause and angle and we're going to
- 7:28multiply that by five by the way five is
- 7:30the radius so how uh so the distance
- 7:34between each drop I'm going to have that
- 7:37in here so we'll call radius
- 7:39is equal to five and I'm just going to
- 7:41multiply this by the the radius
- 7:44and local Z is equal to and the math
- 7:47dots DOT sign this time and angle
- 7:51multiplied by the radius now what I'm
- 7:55going to do is get the position so look
- 7:57up position is equal to and C frame
- 8:00multiplied by C frame dot new c-frame
- 8:03DOT new
- 8:05um X comma zero comma Z
- 8:08dot position
- 8:11and then we're going to give the
- 8:13direction so local direction is equal to
- 8:15and position minus C frame
- 8:19dot position
- 8:22and then we need the fourth circle Force
- 8:26now we need a certain Force to push the
- 8:28coin upwards so that it spreads all
- 8:30around
- 8:31so force is equal to the direction
- 8:34loss of x to three don't new and math
- 8:37dot random from uh minus two to two and
- 8:43comma 30. so we're going to put it push
- 8:46it up 30 studs
- 8:48uh that's not random minus two to two so
- 8:53I thought it's a bit randomized now what
- 8:55I'm gonna do is drop dot position is
- 8:59equal to C frame dot position
- 9:03and then drop the assembly
- 9:07so assemble linear velocity assembly
- 9:10linear velocity is equal to force
- 9:13multiplied by drop dot assembly Mass
- 9:18now we're going to wait one second so
- 9:20that's the right one and
- 9:23I'm going to add a value that will allow
- 9:25us to color the drop so local can
- 9:27collect
- 9:28is equal to
- 9:30instance.new string value
- 9:34strength value and can collect dot names
- 9:37equals you can collect and can collect
- 9:41stop parent is equal to the drop itself
- 9:45and then okay so we are done with our uh
- 9:49drop currency thing now what I'm gonna
- 9:51do is call this is find when we should
- 9:55call this function
- 9:56okay so what I'm gonna do is go to
- 10:00view workspace okay so selection Swap
- 10:04and I'm going to go to the plus icon and
- 10:06I'm going to search for award actually
- 10:09sorry I'm going to search for end value
- 10:11and this is just going to be how much
- 10:13we're gonna how much we're gonna award
- 10:16the player for destroying this drop I'm
- 10:19going to set it to 100 coins
- 10:22and I'm just going to rename it to coin
- 10:26value or maybe coin Awards
- 10:31and I'm just going to paste it inside of
- 10:34this one too okay so red drop
- 10:37I'm just going to do the same thing and
- 10:39what I'm going to do now is add is go to
- 10:42okay I'm gonna go to the main client
- 10:46script and in here when we destroy the
- 10:49drop what I'm going to do is fire a
- 10:51remote event so
- 10:53uh I'm going to add a remote and I'm
- 10:55going to call it
- 10:57okay I'm going to call it Awards on
- 11:00Destroy Okay so
- 11:01add a remote event and I'm going to call
- 11:04it where is it
- 11:05where is it okay why don't you call it
- 11:07award
- 11:09on Destroy
- 11:12and then what I'm gonna do here is just
- 11:14do uh remotes dot fire actually dot
- 11:18award on Destroy called fire client on
- 11:22fire server sorry
- 11:23and that's just going to take the drop
- 11:27the jobs name so maybe drop
- 11:31dot name
- 11:32okay so drop.name and what I'm going to
- 11:35do next is just go to the okay so where
- 11:39is the main server script the one I'm
- 11:42gonna do is
- 11:43game don't replicator storage don't
- 11:45remote stop uh word under on destroyed
- 11:49on server in the on server event command
- 11:53connect function actually I'm sorry we
- 11:55need to make this a remote function I'm
- 11:58really sorry about that
- 12:00so just add the remote function here
- 12:02remote function and just call it same
- 12:04thing award Awards on Destroy
- 12:09and I'm just going to go back here and
- 12:11I'm going to do the okay so local result
- 12:15local result is equal to remotes don't
- 12:18we don't destroy from fire server called
- 12:21invoke server invoke server and that
- 12:23should work now go back to your main
- 12:25client scripts and make game the
- 12:27replicated storage.remotes.org
- 12:30on destroyed don't server info is equal
- 12:33to function that's going to take the
- 12:35player
- 12:37and the object or the um drop name
- 12:42and DC frame solo and the CF
- 12:46okay so object C frame
- 12:49or actually actually yes
- 12:54Okay so
- 12:56yeah I'm gonna do that
- 12:58okay so what I'm gonna do actually I'm
- 13:01not going to get this C frame
- 13:04okay so local
- 13:08okay so local drop
- 13:10what I'm going to do is check if the
- 13:12player actually has the area in which
- 13:16the drop is contained so
- 13:19what I'm going to do is check if
- 13:22layer
- 13:25if player don't
- 13:27areas
- 13:30okay so we have a an area's thing so if
- 13:34blow the areas gonna find first child
- 13:39uh drop area
- 13:42then
- 13:43we're going to continue but we need to
- 13:45set this variable so local drop area is
- 13:47equal to nil and we're going to set this
- 13:50drop area so for underscore come again
- 13:53pairs workspace
- 13:55impairs main folder underscore workspace
- 13:57Dot
- 13:59drops come and get children do
- 14:04for underscore comma drop
- 14:06actually this V should be renamed to
- 14:08area for underscore command drop
- 14:10and pairs area
- 14:12come and get children
- 14:14do
- 14:16and what I'm gonna do is just check if
- 14:21drop.name is equal to drop name
- 14:24and then and drop area
- 14:28is equal to area dot name
- 14:33okay so this should okay this should
- 14:37work now I'm just going to check if drop
- 14:40area then
- 14:43we're gonna check if the player actually
- 14:45owns the area
- 14:47and then we are going to generate some
- 14:49guids okay
- 14:51so what I'm gonna do is just create the
- 14:54table for the gyd so I'll call gy this
- 14:56is equal to and I'm stable
- 14:59and now we need to get the actual drop
- 15:03so local drop
- 15:06is equal to nil and after setting this
- 15:09drop is equal to
- 15:11drop and actually this should be V let
- 15:15me change this to V
- 15:19okay and this should be dropped area
- 15:22so just do this
- 15:23and now I'm going to change okay and
- 15:26then we're gonna break break this now
- 15:29what I'm going to do is local
- 15:31um
- 15:32coin award is equal to drop dot coin
- 15:37award dot value so coin Awards
- 15:40dot value
- 15:43now what we're going to do is go back
- 15:44here and on the surfaces and all the
- 15:47surfaces in here when I get HTTP service
- 15:49HTTP service
- 15:51is equal to gamecom get service HTTP
- 15:54service and then I'm going to scroll
- 15:56down
- 15:57and in the guidance here what we're
- 16:00going to do is generate so we want to
- 16:03spawn five different coins
- 16:05so for I is equal to five from one to
- 16:09five do
- 16:11and local guid is equal to http service
- 16:15call generate gyd and just
- 16:19we don't need to wrap this in curly
- 16:21braces so just false
- 16:24and table dot inserts
- 16:27gyd's comma uh gyd so gyd command g y d
- 16:33not gyd is comma gyds okay now what we
- 16:37need to do after inserting that what I'm
- 16:39going to do is just
- 16:42okay
- 16:44so I'm gonna go up here and I'm going to
- 16:47create a table
- 16:49it's going to be cold
- 16:52uh coin drops
- 16:55and it's going to be equal to an empty
- 16:57table
- 16:59and
- 17:02on the player added event what we're
- 17:04gonna do is just okay so if not
- 17:08coin drops square brackets player then
- 17:11coin drops square brackets player is
- 17:14equal to a table
- 17:16and now I'm going to scroll down here
- 17:19and okay
- 17:22so
- 17:23I'm going to look through the gyds for I
- 17:26can't be in pairs gyds do
- 17:29and tabletop insert table dot inserts
- 17:34uh gem drops gem drops I mean coin drops
- 17:38coin drop coin what am I doing coin
- 17:40award
- 17:42what
- 17:43coin drops
- 17:45on drops square brackets a player comma
- 17:49V
- 17:51now what we need to do is
- 17:54just return true okay
- 17:59actually we are going to return the okay
- 18:01so we're going to return
- 18:05hmm okay I'm going to return
- 18:10true
- 18:13yeah that's it I'm just gonna return
- 18:14true
- 18:15and I'm going to fire a remote
- 18:19uh called
- 18:21drop coins so I'm going to go to the
- 18:24remotes folder
- 18:28uh where is it
- 18:30remote and I'm going to add a remote
- 18:32event
- 18:33called drop
- 18:35coins
- 18:38now what I'm gonna do is just
- 18:40in here uh remotes games or replicator
- 18:44store again storage don't remote stop
- 18:46drop coins calling five clients that's
- 18:49going to take the player
- 18:51uh object c times object CF
- 18:55comma and dg1 these list and in here
- 18:59we're also going to send the of the
- 19:01object
- 19:03CEF
- 19:05and I'm going to go back here to the
- 19:07main client and when we send this we're
- 19:09going to send drop dot uh primary part
- 19:13primary part
- 19:15C frame
- 19:17now we're going to go back to the main
- 19:19server okay so this looks good
- 19:22so what I'm going to do next is just go
- 19:25back to my main client script
- 19:30okay so go back
- 19:33to the main client script and what I'm
- 19:36going to do is remotes dot dropcoins
- 19:38don't answer online event connect
- 19:40function and it's going to take the C
- 19:44frame comma gyds
- 19:48and then I'm just going to go up here
- 19:50and just do local uh currency
- 19:53dropper it's equal to require
- 19:58and just a layer
- 20:01okay where is it where is it
- 20:06script.parent dot currency dropper
- 20:09script.parents can't wait for child
- 20:11currency dropper and currency dropper
- 20:15or drop currency and that's going to
- 20:17take uh replicated storage dot assets
- 20:21not currency drops dot coin drop comma
- 20:25and that's also going to take
- 20:27the
- 20:30number that we want to spawn so five
- 20:32comma C frame plus Vector three dot new
- 20:35zero comma four comma zero so we're
- 20:38gonna spawn the coins a bit up
- 20:42by four studs and we're also going to
- 20:44send the gyds
- 20:46okay so this should work so I'm gonna go
- 20:49ahead and play the game
- 20:51see if this works
- 20:53all right so I'm just going to go ahead
- 20:55and equip my pet
- 20:58I'm gonna equip my pet and I'm just
- 21:01going to just send it over to the red
- 21:04drop
- 21:05and I do not have my area's value so I'm
- 21:09just going to buy the area number two
- 21:13and then I'm gonna go okay so I bought
- 21:16area one now this should be an area one
- 21:20I'm gonna check
- 21:21drops area one okay so this one is in
- 21:24area one so I'm going to click this
- 21:27wait for it to destroy and we're gonna
- 21:29see what happens
- 21:32as you can see nothing happens which
- 21:34means we got an error
- 21:36so uh going Awards don't vow okay so
- 21:40coin Awards is equal to Value not
- 21:43validity
- 21:44no I'm gonna play the game again and see
- 21:47if this works
- 21:49okay so this still doesn't work it says
- 21:52server script service then index nail
- 21:54with coin Awards so coin Awards is not
- 21:59a thing
- 22:01hmm
- 22:03so coin award
- 22:05drop dot coin Awards
- 22:11okay so I think this
- 22:15should work and I think the problem is
- 22:17we don't have the actual drop here
- 22:21so I think that's why this is happening
- 22:24and that's oh that's why this should be
- 22:27drop is equal to V
- 22:28and everything should work fine now
- 22:33okay so I'm gonna join the game
- 22:35uh by the first area why does it not
- 22:39play between though okay that's weird
- 22:41I'm not I could equip a pet and I'm
- 22:44going to destroy this one
- 22:48and it destroys it and it spawns the
- 22:52coins
- 22:54okay
- 22:57so they do spawn
- 22:59now what I'm gonna do is make a system
- 23:01for collecting the drones
- 23:06okay so to do that it's very easy we are
- 23:09just going to add a moduscript
- 23:13here
- 23:15or maybe you can just do it in the main
- 23:16client script I'm just going to do okay
- 23:19so
- 23:21uh my service dot heartbeat okay I'm
- 23:23gonna do it in here
- 23:26okay so we're gonna we're gonna need to
- 23:29get the
- 23:32actually
- 23:33okay I'm just gonna do it in here on
- 23:35service dot run dot render steps come on
- 23:39connect function
- 23:40and we're gonna need
- 23:43two variables we're gonna need the okay
- 23:47so local rebound stable or DB is equal
- 23:51to an empty table and local distance
- 23:52from which we can collect so distance is
- 23:55equal to 12. so 12 starts away and what
- 23:59I'm going to do in here is get the
- 24:00player's character so local character
- 24:03is equal to player.character or player
- 24:05dot character round that's going away
- 24:07and we're going to check if the
- 24:08character is there then so if it is
- 24:10there then when I Loop through all the
- 24:13currency drops so for underscore come
- 24:14with the in pairs main folder okay so
- 24:17workspace dot main folder or workspace
- 24:20won't wait for child demand folder on
- 24:21the school workspace going to wait for
- 24:23you to wait for child currency drops
- 24:25don't get children do and if V Dot if
- 24:30square brackets feed off position so the
- 24:33V Dot position minus character dot
- 24:37primary part
- 24:39stop position
- 24:43dot magnitude
- 24:45dot magnitude by the way we'll do this
- 24:48outside of the brackets is less or equal
- 24:51to the distance then
- 24:54actually and the confined first child uh
- 24:58can collect
- 25:00then
- 25:02the line cards dot anchored
- 25:05is equal to True
- 25:08um between service call create
- 25:11oncreate a v comma between info dot new
- 25:160.2
- 25:18and comma square brackets I mean curly
- 25:21brackets C frame is equal to
- 25:24character
- 25:26don't humanoid report dot C frame
- 25:31character's not humanoid part C frames
- 25:33column play
- 25:34and then what we need to do is just
- 25:37check okay so if
- 25:40then um
- 25:43way so we check that and then
- 25:47okay
- 25:50so after doing that we are also going to
- 25:53check if the dot position
- 25:57minus character dot primary
- 26:00part.position
- 26:02dot magnitude is less or equal than
- 26:05three then
- 26:09uh if not square brackets the bounce
- 26:14if not ZB
- 26:15okay so if not DB square brackets V then
- 26:20DB score back as V is equal to true and
- 26:24if okay so I'm just going to uh
- 26:28remote stop give
- 26:30I'm going to add a remote event in here
- 26:32I'm going to rename it to give coins
- 26:35and remote stop give coins call on fire
- 26:38server
- 26:40and that's going to take the video ID
- 26:43default value
- 26:45and then what we're going to do is okay
- 26:49so V Dot ID dot value
- 26:52hmm if you don't like you don't value
- 26:56and we will wait five seconds so that's
- 26:59got wait five seconds
- 27:01and DB square brackets V is equal to nil
- 27:05and
- 27:07the con destroy
- 27:10when it gets that close we're gonna
- 27:11destroy it
- 27:14so now I'm going to play the game and
- 27:16just hope that this is gonna work
- 27:19now it's not going to give us coins yet
- 27:22but I just want to see if the collection
- 27:23will work
- 27:24why did the why did this just disappear
- 27:27oh it's because I it's because I own it
- 27:31okay so I'm just going to send this here
- 27:34and I'm going to get away
- 27:36let's see this is gonna work it drops
- 27:38the coins if I get close to them
- 27:40that I can collect them okay great but
- 27:43now I think that they're okay so now I
- 27:46wanted to give the player the coin so
- 27:48main service main server
- 27:51and game.replicator storage dot remote
- 27:56server event contact function layer
- 28:01and what we need to do now is just go
- 28:04here okay so I'm just gonna think about
- 28:07this
- 28:08okay if table don't find
- 28:11uh coin drops square brackets player
- 28:15comma gyd
- 28:18no actually this is going to take the
- 28:20letter and the gyd
- 28:22then
- 28:23I'm also going to go back
- 28:27um where is it
- 28:29so on the main clients we do send the ID
- 28:32okay so gyd then a player
- 28:36dot stats
- 28:39dot coins dot value
- 28:43plus equal to the amount now we're going
- 28:45to get this amount shortly but for now
- 28:47it's just going to be one and then table
- 28:49don't remove
- 28:51uh coin drops square brackets uh player
- 28:55comma table dot find uh coin drops
- 28:59square brackets player comma gyd
- 29:04just make sure you're doing it correctly
- 29:05now I'm going to think of a way to get
- 29:07the amount
- 29:08but I'm just going to play the game for
- 29:10now and see this is going to give me
- 29:12coins
- 29:13okay so if I equip my pet
- 29:18and just send it here
- 29:21just stand there
- 29:24and if I go ahead and collect my coins
- 29:27I do not get anything
- 29:29oh
- 29:32I'm sorry uh changes to layer stats
- 29:34later
- 29:36stats
- 29:38play the game again
- 29:40okay so it's almost destroyed it's
- 29:43destroyed now which should okay so it
- 29:45does give me coins now and it's secure
- 29:48but now we need to figure out a way to
- 29:49get the amount
- 29:52okay so I got it working and the way
- 29:54this is by okay so in here when we are
- 29:58looking through the zyds I changed so
- 30:01coin drop square brackets player score
- 30:03brackets V is equal to an empty table
- 30:05and inside of that table we are creating
- 30:08this Awards uh thing and we are variable
- 30:11and we are setting it to uh meth.round
- 30:15coin award divided by five so just to
- 30:17add these two lines of code and now down
- 30:20here I'm checking if coin drop score
- 30:22back it's player
- 30:24and we find the gyd in there then we are
- 30:28adding up to the players coins values
- 30:31uh so coin drops go back his player
- 30:34score brackets gyd square brackets
- 30:36towards so we are adding that value
- 30:39and we are just removing that from the
- 30:42table so just copy this and paste it in
- 30:44and it should work just fine so if I
- 30:48just wait for my pets to load in
- 30:52um equip it and I'm just going to send
- 30:54my pet there
- 30:56this should work
- 30:59I'm just going to wait for this and it
- 31:02does work so I'm just going to collect
- 31:04these
- 31:05and as you can see they do give me quite
- 31:07a lot of coins and that is because
- 31:10um
- 31:11it's 100 divided by five so each coin is
- 31:13worth that value now what I'm gonna do
- 31:16is just close all these and I'm just
- 31:19going to put this one inside of the
- 31:22first area too
- 31:26and now what we need to do is get rid of
- 31:28the area 2 folder
- 31:31and now when we are I want to see if we
- 31:35can still send the pads
- 31:38if we can still do that then we need to
- 31:41fix it because we should only be able to
- 31:43send the pads to the areas that we have
- 31:47oh actually I can do that but I'm gonna
- 31:51check what will happen if I remove my
- 31:54area one value
- 31:58and we can still attack it so we're
- 32:00gonna have to fix that
- 32:01it's very simple we just enter our
- 32:06um where is it
- 32:09I think I have another main server
- 32:11script
- 32:13okay right here on the main server
- 32:15script what we should do is check if
- 32:19Okay so
- 32:21if
- 32:23layer
- 32:24dot areas confine first child
- 32:29first child
- 32:32um drop
- 32:34stop parents
- 32:36okay so if player
- 32:40okay where is this so drop
- 32:44dot parent
- 32:46dot name then then we're going to do all
- 32:50this
- 32:52if not then nothing's gonna happen
- 32:55okay so now what I'm gonna do is add a
- 32:58default area to my areas value so I'm
- 33:01just going to add in a
- 33:04string value is just going to be renamed
- 33:06to area one
- 33:09and this is going to be named area
- 33:13actually this is going to be renamed to
- 33:15area 0.
- 33:17so the default area is the area zero
- 33:21and the these two should be in the area
- 33:24zero
- 33:30okay
- 33:31now this should work
- 33:41okay so drops area zero I should have
- 33:44area zero so I should be able to
- 33:48do that
- 33:50so I should be able to attack them both
- 33:52of them
- 33:54but if I just go ahead and change this
- 33:58name this parent's name to Ariel one
- 34:02and then I should not be able to attack
- 34:04it so as you can see nothing happens
- 34:07I'm just going to leave the game now and
- 34:10yeah that's going to be it for today's
- 34:11tutorial if this helps make sure to
- 34:13subscribe like the video share it with
- 34:15your friends and I'll see you all in the
- 34:17next video bye
About this transcript
This page contains the full transcript of How to make A Pet Simulator X Game on Roblox - Part 7 by polarisprog, generated from the public captions YouTube serves with the video. The transcript has 4,545 words across 738 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.