[Part6.5] Easy Roblox Combat System for Beginners | Episode 6 Summary & Minor Additions — Transcript
Full transcript
- 0:00All right, welcome to 6.5.
- 0:05Little intermission between the seventh
- 0:07episode and the sixth one.
- 0:10So, last episode, it was honestly really
- 0:13kind of a mess. So, this episode is
- 0:15mainly to
- 0:16have some little additions and some
- 0:18fixes,
- 0:19as well as reiterate on what we did in
- 0:23the previous episode to hopefully make
- 0:25it more concise and have a better
- 0:27explanation for it.
- 0:28So, yeah, let's get into it.
- 0:31So, the first thing I want to address is
- 0:34the state service.
- 0:36So, you'll notice last episode, we have
- 0:39a lot of these
- 0:41if and or statements over here that we
- 0:43could definitely condense into like a
- 0:45different
- 0:47state service that we can access. So,
- 0:50we're going to move the state service
- 0:52from
- 0:53the service script service to the mouse
- 0:56rules, like so.
- 0:58And here, we can keep it the same.
- 1:01And one thing we want to add is the run
- 1:04service variable in here.
- 1:07So,
- 1:08basically, when we created the folder
- 1:11for the status folder,
- 1:13we don't want the client to be creating
- 1:15this. We only want the server to be
- 1:17creating this.
- 1:18So, we can say something like if
- 1:21run service is server, then we create
- 1:23it.
- 1:25Otherwise, we'll just return and
- 1:29so, we'll just end the script because we
- 1:31only want the status folder to be made
- 1:32on the server if there's none.
- 1:34So, that's going to be the first
- 1:36addition.
- 1:37And the next one is actually changing
- 1:39every
- 1:41variable we created for a state service
- 1:43to the new parent.
- 1:45So, if you press control, shift, and F,
- 1:48you can view all of the locations that
- 1:50you put for it.
- 1:52So, we can look up state service and
- 1:53we'll see all of the places we have.
- 1:56So, the first place we'll look is the
- 1:59combat system,
- 2:01which we know that is a script up here.
- 2:04We'll just change this to modules
- 2:06{dot} state service, like so.
- 2:10So, that should be fixed for that.
- 2:12And then, let's see what else.
- 2:15Over here, we'll also change this to
- 2:17modules {dot} state service.
- 2:21Like so.
- 2:23Let's see what else right here.
- 2:28Modules {dot} state service and
- 2:33over here.
- 2:35Modules {dot} state service, and that
- 2:37should be it for that.
- 2:42So, if we exit out all of these scripts
- 2:44and we
- 2:47play the game,
- 2:48let's see
- 2:50what happened here.
- 2:52Character is not a valid member of
- 2:56Duh, duh, duh.
- 2:57Let's see
- 3:00what this is. Oh,
- 3:02this was moved to configuration for some
- 3:04reason. We always want it to look like
- 3:05this.
- 3:07And now, if we play the game,
- 3:09everything should be running fine.
- 3:12And if we let suck, you'll see that it
- 3:14works.
- 3:18Everything should be working fine.
- 3:23There we go. Like so.
- 3:27All right. Um, so, next thing we want to
- 3:29do is
- 3:32implement the new state service add-on
- 3:34into the input script.
- 3:39So,
- 3:43we will do that.
- 3:46So, over here, we can require the state
- 3:48service. So, we can say
- 3:50state service equals require
- 3:52modules.state service.
- 3:55And then, instead of doing all of this
- 3:57like extra things, we can just say
- 4:00if state service.check state, character,
- 4:03{comma} let's say
- 4:05stunned, blocking,
- 4:09attacking,
- 4:10no sprint,
- 4:12no move, dashing,
- 4:15that's cool down,
- 4:16then we just return false like so.
- 4:19I will leave it at that. And we can do
- 4:21the same thing for here.
- 4:24So, we can say stunned, blocking,
- 4:26attacking, no sprint, no move.
- 4:31And there we go, like so.
- 4:36And if we do that,
- 4:39there we go.
- 4:42And now, let's see if there's any other
- 4:44places that we want to do that at. Let's
- 4:46see.
- 4:49Nope, that'll be fine.
- 4:52And okay, another thing we want to do is
- 4:54we want to fix the
- 4:58Well, I want to reiterate what we did
- 5:00for the idle, the run, and things like
- 5:02that.
- 5:04So, first things first is that we want
- 5:06to remove previous idle cuz in previous
- 5:09run cuz we're not We're not using that
- 5:11anymore cuz if you see that if we press
- 5:13Ctrl F and look it up, the only places
- 5:16that we have it are in the function.
- 5:17We're not We're not calling the same way
- 5:19we were else.
- 5:21So, we can just remove this and we can
- 5:25remove this.
- 5:29Remove this and remove this, like so.
- 5:33And if we go down here to change idle,
- 5:36we look it up.
- 5:38And let's see. All right. So, let's
- 5:42start from the place where we actually
- 5:44started playing the animation so I can
- 5:45hopefully explain it for you.
- 5:48So, right here, we we're checking if the
- 5:51player is either jumping or in the air
- 5:53or anything like that.
- 5:55If that's the case, then we want to stop
- 5:57all of the idle and run animations cuz
- 5:59we don't want them playing.
- 6:01The same thing with when the player is
- 6:02dashing or the player is at the end of
- 6:04the dash. You want to stop that.
- 6:07So, the reason return works in this case
- 6:10is because we have it in a different
- 6:12thread, which I mentioned in the first
- 6:14video in the series, I believe.
- 6:16So, threads basically just create a new
- 6:19a new parallel for the script to run at.
- 6:21So, if you do return, it's only going to
- 6:23return the whole thread. It's going to
- 6:25stop the whole thread from running, not
- 6:26the whole script.
- 6:29So, over here, we commented the idle
- 6:31section.
- 6:33So, if the player is moving, then we
- 6:35want to stop all the idles
- 6:39because that just makes sense.
- 6:41Otherwise,
- 6:43if the player isn't moving, we want to
- 6:45stop all of the run animations. And we
- 6:48want to check for the new idle the
- 6:50player has.
- 6:52And we're going to loop through all of
- 6:53the idle animations and stop all the
- 6:56ones that aren't that isn't the current
- 6:58idle that we have.
- 7:00And then, of course, we want to play the
- 7:01new idle.
- 7:03And then, moving on to the sprinting
- 7:04section,
- 7:06we're checking if the player is moving
- 7:08and we're sprinting at the same time.
- 7:11If those if that condition or those two
- 7:13conditions are fulfilled,
- 7:15we will stop the idle animation and we
- 7:17will check for the run
- 7:20or change run.
- 7:22So, you see that we initialize a
- 7:24variable called return table, but we're
- 7:26not using it anymore, so we can just
- 7:27remove that and just change it to change
- 7:29run like so.
- 7:31And the same thing over here.
- 7:33Just remove that.
- 7:36Now,
- 7:37going back to this, we are doing the
- 7:39same thing similar to the idle
- 7:41where we're checking for all the runs
- 7:43that that aren't named to the current
- 7:45run value
- 7:47and we're stopping those.
- 7:48And then otherwise, we're just going to
- 7:50play the new run
- 7:52animation.
- 7:54And if the player is not moving and
- 7:56they're not sprinting, we just stop all
- 7:57the running animations like so.
- 8:00And that is the condensed version,
- 8:03hopefully an explanation of how we did
- 8:05the idle and sprint animations.
- 8:10And yeah.
- 8:13So, if we play the game
- 8:18you'll see that all of our new state
- 8:20services are added
- 8:22using the shared state controller that
- 8:24we see in
- 8:26modules.
- 8:37All right. So, you'll notice that the
- 8:39animation is sort of
- 8:41causing the player to just flail their
- 8:42arms in the air.
- 8:44So, in order to fix that, we can just
- 8:46add a check statement right here
- 8:49that's checking if the player is
- 8:51dashing. So, we can say
- 8:53if state service that check state
- 8:55character comma dashing, then return.
- 8:58Or instead of say saying return, we can
- 9:01say else.
- 9:03Or
- 9:04scratch that, we can say if not state
- 9:05service that check state character comma
- 9:07dashing
- 9:08then remote set up fire server.
- 9:13We can also add on to this, we can say
- 9:14if they're not blocking, if they're not
- 9:17attacking
- 9:19then we can do all of that. And if
- 9:21there's no dash and lag, then we can do
- 9:22that, too.
- 9:24And lag, I believe, is what we called
- 9:26it.
- 9:28Yeah.
- 9:29And lag with a lowercase L.
- 9:32Like so. So, this is just sort of
- 9:33another prerequisite check that we can
- 9:35do
- 9:36alongside with the server where we check
- 9:38for if they're attacking, blocking,
- 9:40cylinder, no punch like so.
- 9:43So, we can also say they're stunned.
- 9:47etc. etc.
- 9:50Mainly, usually when I do this, I just
- 9:52check for any client values that are
- 9:54there
- 9:55that we want to prevent the player from
- 9:56attacking cuz the server already checks
- 9:58pretty much everything.
- 10:00But, the server can't tell if they're
- 10:02dashing or not because the dashing state
- 10:04Yeah, the dashing state is added on the
- 10:06client.
- 10:07So, we just check it over here.
- 10:11So,
- 10:13when you play the game
- 10:15and we dash
- 10:24You see that now we have a smooth
- 10:26transition for the punches.
- 10:30And that's going to pretty much wrap up
- 10:32this sort of shorter video before we add
- 10:35in different weapons in episode 7,
- 10:38which is also going to be released
- 10:39today.
- 10:40So, just to summarize what we did in the
- 10:42video, we moved the state service from
- 10:45service group service to
- 10:47the replicated storage, the shared
- 10:49modules.
- 10:50So, we can access the the service from
- 10:53both the client and the server.
- 10:55And we also added a check because we
- 10:57don't want the status folder to be added
- 10:58on the client instead on the server.
- 11:02And we fixed all the values in here
- 11:05where we just added state service check
- 11:06state.
- 11:07And
- 11:10we went over how exactly animations are
- 11:13played.
- 11:14And yeah, it's pretty much it. Hope you
- 11:16enjoyed this shorter sort of summarized
- 11:19video and see you on episode 7.
About this transcript
This page contains the full transcript of [Part6.5] Easy Roblox Combat System for Beginners | Episode 6 Summary & Minor Additions by Senko, generated from the public captions YouTube serves with the video. The transcript has 1,589 words across 287 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.