[Part3.5] Roblox Combat System for Beginners | Block Animation & Fixes — Transcript
Full transcript
- 0:00All right. Uh, this going to be sort of
- 0:02like a mini update video. So, it's going
- 0:06to be like 3.5 for the whole series.
- 0:10This video, I'm just going to like do
- 0:11some little small changes to the whole
- 0:13system in general, just so we can make
- 0:15things easier to change in the future
- 0:18videos. So, the first thing I'm going to
- 0:20do is fix the issue with the F key held
- 0:24thing, which is kind of inefficient in a
- 0:27way. So, first off, what I'm going to do
- 0:29is get rid of this and change this to is
- 0:33typing and digit
- 0:35false. Now, we'll do the normal input
- 0:38begin
- 0:39things. Let's make this underscore
- 0:41because we're not really going to use
- 0:42this. So, if process then is typing
- 0:45equals true return otherwise is typing
- 0:49is
- 0:51false. Now, if we scroll down here, we
- 0:54can get rid of this.
- 0:56We can also change this
- 0:59to if user input service is key down
- 1:04code.f and not is typing then we can
- 1:09block otherwise we'll just unblock
- 1:13them.
- 1:15So play the game a little bit.
- 1:21All right. If you block or hold F,
- 1:24you'll see that we block. And if we
- 1:25start typing, it just stops blocking.
- 1:27And if we press F while we're typing, it
- 1:29doesn't block again. Only when we are
- 1:32actually blocking in the game like
- 1:37so. All right. Next thing I'm going to
- 1:39do is I'm going to make uh the block
- 1:42animations
- 1:44work. So in the description, I'm going
- 1:46to have linked the animation dummy from
- 1:48before, and it's going to be updated
- 1:49with block animations. So block idle,
- 1:52block broken, which is uh these three
- 1:55animations are going to be used in
- 1:57today's video, episode
- 2:00four. But in
- 2:02here in the add state function, we're
- 2:05going to add a variable called
- 2:08attributes or a parameter called
- 2:10attributes and just call it any which
- 2:12it's going to be a
- 2:13table. And then now before we parent it,
- 2:16we'll see if attributes is a thing.
- 2:19attributes. Then we will loop through
- 2:22the attributes and we'll say new state
- 2:25set attribute name, value like
- 2:30so. Now we can go to our comma system
- 2:33and we can do comma. We don't want to
- 2:35have a deration. So we just set that to
- 2:37nil. And then for attributes we can say
- 2:40weapon name is equal to our found
- 2:45name. Like so. Now we want to actually
- 2:49play the block animation. So we can say
- 2:50playing block
- 2:53animation and we'll put this in a
- 2:55separate thread. So if it errors then um
- 2:58it won't negatively impact the script in
- 2:59a way. So we'll say local core folder
- 3:02equals
- 3:05character.core local animations or
- 3:08loaded animations and say equals
- 3:13require actually no let's not do this.
- 3:17Let's reference all the variables up
- 3:19here first. So local core folder equals
- 3:23character fun core. If not core folder
- 3:26then return end local animations module
- 3:29and we can
- 3:31say if core
- 3:33folder or let's get rid of
- 3:36this. Let's say actually no. Okay. If
- 3:41core folder and core folder find
- 3:43animations then
- 3:49No. Okay. Local animations module equals
- 3:53core folder find shot animations. If not
- 3:56animation module then return end.
- 3:59Otherwise we can say local anim local
- 4:01loaded animations equal require
- 4:03animation modules dot loaded animations
- 4:06because remember our all of our
- 4:08animations are in
- 4:09here. So we can say loaded animations.
- 4:13Now we can say loaded
- 4:16animations whatever our weapon name is.
- 4:18So
- 4:19fool.name dot dot
- 4:25dot block. So block dot idle play like
- 4:30that cuz remember that's how we made it
- 4:32to where we can reference animations. So
- 4:34we have fist.block
- 4:37idle. Now in
- 4:39here we can say local we can remove the
- 4:42remove state thing local uh blocking
- 4:46instance equals status folder. So
- 4:48character status find shot
- 4:51blocking if blocking instance then we
- 4:55can get the to name attribute. So
- 4:59local weapon name equals blocking
- 5:01instance get
- 5:03attribute weapon name. If weapon name
- 5:07then and let's destroy it down here.
- 5:09Destroy the blocking instance. But if we
- 5:11found the weapon name then we can say
- 5:12loaded
- 5:13animations. Weapon
- 5:16name dot dot dot do.block idle
- 5:21stop.1 like so. 0.1 is just sort of like
- 5:24the fade where if you set it to zero the
- 5:28animation like stops abruptly but 0.1
- 5:30gives gives it a little bit of time to
- 5:32like fade away in a way.
- 5:34So, if we play the
- 5:37game, we'll see that the blocking
- 5:39animation does play like so. And if you
- 5:42unblock, it stops
- 5:47playing like
- 5:49so. Also, what I'm going to do is I'm
- 5:51going to add a blocking cool down. So,
- 5:54when the player stops blocking, we can
- 5:56go to state service add state character,
- 5:59comma, no block, comma, let's say like
- 6:0204.
- 6:04So after the character finishes
- 6:05blocking, they can't they have a certain
- 6:07thresh threshold they have to meet
- 6:08before they can reblock again which is
- 6:11the cool down 4
- 6:13seconds.
- 6:15So let's see. Yep. Over here if we check
- 6:18the state and it has no block then you
- 6:20can't block.
- 6:22So if we play
- 6:26again, let me
- 6:31block. You see that there's sort of a
- 6:33delay before you can block
- 6:37again. And
- 6:40yeah, that's so the reason we do it like
- 6:44this, right, is let's say we have
- 6:45another weapon called uh katana in the
- 6:48tools.
- 6:50If we unequip the
- 6:54um the katana or the um the fist
- 7:00tool, then the server will check for the
- 7:03previous blocking state or instance and
- 7:07it'll find the corresponding weapon name
- 7:09with it. So we can just stop playing the
- 7:11animation. So this and all is compatible
- 7:15with many different type of weapons
- 7:16which I'll show you in the future
- 7:18videos.
- 7:21So yeah, that's pretty much all I wanted
- 7:23to do for sort of this intermediate
- 7:26intermission video. So we fixed the
- 7:29issue with the holding F thing while
- 7:32we're typing with these lines right
- 7:34here. And we added an attributes sort of
- 7:39um parameter to the
- 7:41state and using that we made it to where
- 7:44you can play animations while you're
- 7:46bucking. And yeah, that's pretty much
- 7:48it. Episode 4 will be released later
- 7:51today, which will handle or show youall
- 7:55how to do sort of hit types, which if
- 7:58you hit the dummy, it'll be stunned. But
- 8:01if the dumy's blocking, then it'll have
- 8:03like a little um a blocked hit type
- 8:06rather than a default stun type. And if
- 8:10you hit them with your last M1, it'll
- 8:11block pick
- 8:13them. And yeah, that's pretty much it.
About this transcript
This page contains the full transcript of [Part3.5] Roblox Combat System for Beginners | Block Animation & Fixes by Senko, generated from the public captions YouTube serves with the video. The transcript has 1,090 words across 178 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.