YouTube2Text

[Finale] Roblox Combat System for Beginners | Showcase & Fixes — Transcript

by Senko · 2,430 words · 375 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Hey everybody, welcome to the last video
  2. 0:04of the combat tutorial series. Um, today
  3. 0:09I'm just going to be fixing a couple
  4. 0:11more bugs and issues with the combat and
  5. 0:13then uh going over all the scripts and
  6. 0:16then playing the game, showcasing it for
  7. 0:18youall. Um, so basic, so essentially I
  8. 0:21decided to just open source the whole
  9. 0:23thing once I hit around 600 subs and
  10. 0:26we're getting pretty close, which is
  11. 0:28crazy considering
  12. 0:30that I've I've just gotten so many
  13. 0:33subscribers within the past couple
  14. 0:34weeks. It's been great. And yeah. All
  15. 0:37right, so the first thing we're going to
  16. 0:39do is fix this block reaction thing. So
  17. 0:44you see if we join the game and take out
  18. 0:47our sword and we hit the D. You notice
  19. 0:50that the animations kind of bug and of
  20. 0:53course we get an
  21. 0:54error. So similarly, the reason this
  22. 0:57happened is because the animations
  23. 0:59aren't loaded in yet, which is why we
  24. 1:02made the hit reactions a part of the
  25. 1:04characters
  26. 1:05animations. So we can also just do it
  27. 1:07for that. So we can go over here
  28. 1:10to our blocked script and we can look
  29. 1:13for the blockstroke. So we go to
  30. 1:15block.reactions blah blah blah right
  31. 1:17here. So in here we can add something
  32. 1:20called uh block
  33. 1:22reactions and then we can add in the
  34. 1:25folders. So fist
  35. 1:27uh dagger and sword like
  36. 1:32so. Now we can just go ahead and drag
  37. 1:34all these
  38. 1:35here. So this is for dagger. So we can
  39. 1:38now go ahead and remove
  40. 1:40this actions folder and do the same
  41. 1:42thing for fist and our sword.
  42. 1:50And then let's go this for
  43. 1:53sword. And this should be good now. So
  44. 1:56since we changed the location of our um
  45. 2:00block reactions, we need to change in
  46. 2:02the script too. So we can go over here
  47. 2:04and go to call this character.block
  48. 2:07block reactions dot whatever our weapon
  49. 2:11used
  50. 2:12is dot dot dot and then two string the
  51. 2:16random stroke like so. And now if we
  52. 2:20play the game the animation should be
  53. 2:21fixed. So we go over here equip our
  54. 2:24sword. Oops. Let's see. Character
  55. 2:29dot character dot block
  56. 2:33reactions dot weapon used
  57. 2:37And then oh right here. So we have to do
  58. 2:40two string shrug one. So it corresponds
  59. 2:43to
  60. 2:44this. And then if we play the game we
  61. 2:47should be
  62. 2:52good. As you can see the animation's
  63. 2:54load now. All right. So now that that is
  64. 2:58done. I'm just going to go over all the
  65. 3:00scripts
  66. 3:01again. So basically just everything from
  67. 3:04episode one to now.
  68. 3:07So, first off, I'm going to go over how
  69. 3:08we organize the workspace. So, let me go
  70. 3:11ahead and move all of these to um the
  71. 3:14map
  72. 3:15folder. So, typically in games, we
  73. 3:17usually like to organize them in
  74. 3:19folders. So, we want to prevent any
  75. 3:21unnecessary extra hanging parts in the
  76. 3:24workspace in
  77. 3:26general. So, I made a world a world
  78. 3:28folder and then I also added effects,
  79. 3:31hitboxes, live, which are just the
  80. 3:33characters or the players in the game.
  81. 3:35and map which contains everything having
  82. 3:38to do with the
  83. 3:39map. And now if we go to replicated
  84. 3:43storage, we also have folders in here.
  85. 3:46So we have remote events which handle
  86. 3:47our replicating our VFX, blocking and
  87. 3:51attacking. We have modules. So our state
  88. 3:55service which we condensed it into three
  89. 3:58different functions our check state
  90. 4:01remove state and add state which
  91. 4:03previously in a previous video we had it
  92. 4:06in our systems folder but since we moved
  93. 4:09it to replicated storage it's accessible
  94. 4:11from both the client and the server now.
  95. 4:14So that's good. And we have weapon data
  96. 4:16just to obviously get what type of
  97. 4:19damage we want things like that.
  98. 4:22And let's move over to our service group
  99. 4:25service which contains pretty much the
  100. 4:27bulk of the combat
  101. 4:29system. So we have um let's go over
  102. 4:32let's go over the simple things first.
  103. 4:33Our collision handler which just handles
  104. 4:36the part where we collide with the
  105. 4:38dummies. So you see that you are able to
  106. 4:41not collide with the dummies which
  107. 4:44mentioned in a previous video is for
  108. 4:46things like getting flung if you dash
  109. 4:48into something hard enough. So just go
  110. 4:50through the
  111. 4:51dummy and yeah so how we did that is we
  112. 4:54use collision groups. So brief over
  113. 4:57collision groups again if we go to model
  114. 4:59and collision groups you'll see the we
  115. 5:02set the collision groups of everything
  116. 5:04to players. Well everything as in the
  117. 5:06character and the dummies. So notice
  118. 5:08that the characters or the players can't
  119. 5:10collide with each other which this is
  120. 5:12checked off like
  121. 5:14so. And now if we go to our tool
  122. 5:17handler, this just handles this. So if
  123. 5:20we play the game and we equipped uh our
  124. 5:24baton and dagger, this handles the part
  125. 5:27where we just want to remove any related
  126. 5:29items to the um the weapon once we clear
  127. 5:34them all, which you see that all the
  128. 5:35items get
  129. 5:36removed. So that's that. And we also
  130. 5:39added extra checks and things. So, for
  131. 5:41example, if an item gets added to the
  132. 5:43backpack, we check for that. As well as
  133. 5:46if an item's already there, then we also
  134. 5:48check for
  135. 5:50that. And next up, we go we're going to
  136. 5:52go to our comment
  137. 5:54system.
  138. 5:55So, I I believe in episode 1.5, we
  139. 5:59discussed the idea of caching, which is
  140. 6:02just storing modules in a certain table
  141. 6:06so we're able to call in them again. So
  142. 6:08this is much better than doing require
  143. 6:10script.parent no weapons dot or hit
  144. 6:14types default every single time we want
  145. 6:18to just
  146. 6:19uh call
  147. 6:21that sort of hit effect that we want the
  148. 6:24character to be or we want the target to
  149. 6:27be inflicted upon. So because of that
  150. 6:30we'll just cache modules like so. And
  151. 6:32then as you can see down here
  152. 6:36we are going to attack which we
  153. 6:39find the cache modules the tool name and
  154. 6:42we
  155. 6:44attack. And same thing with blocking as
  156. 6:46well. And uh once again to note you can
  157. 6:50collapse certain parts of the script
  158. 6:52with arrows so you can better read and
  159. 6:55understand where everything is.
  160. 6:59And over here in character added, this
  161. 7:01is essential because we're essentially
  162. 7:02loading the animations of the character.
  163. 7:05So when we load them, this allows for
  164. 7:07our, let's say, our blocked effect that
  165. 7:10we fixed earlier to play because we're
  166. 7:12loading the character animations which
  167. 7:14contain the block reactions, hit
  168. 7:15reactions, and
  169. 7:18block. And now if we go over to
  170. 7:21our weapons, let's go sword for example.
  171. 7:26And you'll see that okay, we have a
  172. 7:28function called weapon to attack. And
  173. 7:30this just allows the player to
  174. 7:33attack like so. So, let me just go
  175. 7:36through a brief overview of the script
  176. 7:38in general. So, obviously, if we want to
  177. 7:41attack, we need to make sure the
  178. 7:42character is
  179. 7:44not having a condition to where they
  180. 7:47can't attack. So, we use state service
  181. 7:49for that. And we're checking if the
  182. 7:50character is attacking, blocking,
  183. 7:51stunned, or they're just not able to
  184. 7:53punch. Then we just return end which
  185. 7:56just stops script prevents it from
  186. 7:58attacking. And another standard check we
  187. 8:01have is if tool name let's say the tool
  188. 8:03name is equal to sword. If sword is not
  189. 8:06equal to this uh the script's name then
  190. 8:08we return end. And we also want to find
  191. 8:11the configuration folder for the
  192. 8:13tool which is
  193. 8:16this. And over here, we're just adding
  194. 8:19in our or we're cycling through our
  195. 8:23swings and we're playing our
  196. 8:27animations. And down here, we're using
  197. 8:29the client effects remote event to play
  198. 8:32sounds. And right here is just our whole
  199. 8:35hitbox event. And you'll see that we're
  200. 8:38we're using the cached modules that we
  201. 8:40cached earlier up here in the script and
  202. 8:44calling upon them again to work on our
  203. 8:46hit types which block
  204. 8:48break and
  205. 8:50default. And yeah, so essentially the
  206. 8:54weapon types are the same across the
  207. 8:55board. Of course, if you want to edit
  208. 8:57anything, you can just go in here and
  209. 8:59like play around with the animation
  210. 9:00length, things like that. And
  211. 9:03yeah, so let's go ahead and move on to
  212. 9:06our hit types, which we have three basic
  213. 9:09ones. We have default and blocked and
  214. 9:13block break, which default is handles
  215. 9:15when the player hits the player normally
  216. 9:17if they're not blocking or anything like
  217. 9:19that. Uh blocked obviously for when the
  218. 9:23target is blocking and block break when
  219. 9:26the target is being block broken.
  220. 9:30And now we're going to go ahead and move
  221. 9:32on to
  222. 9:34our server script or our um our input
  223. 9:40script. So if we open the input
  224. 9:43script, you'll see that this is pretty
  225. 9:46much uh the bulk of the client side of
  226. 9:49the combat. Hence why it's around 400ish
  227. 9:52lines. But here you see our
  228. 9:54conditionals. We have can sprint, can
  229. 9:56dash, can
  230. 9:57block, and our is moving function.
  231. 10:01And toggle trails is for this. When we
  232. 10:04play the game and we start dashing or
  233. 10:06sprinting, you'll see that the trail
  234. 10:08gets toggled on and we start
  235. 10:10attacking the trail gets changed to red
  236. 10:13for our attacking trail. Oh yeah, and
  237. 10:16another thing we want to note is you
  238. 10:18notice that the hit box is still um
  239. 10:21appearing. So way to remove that is you
  240. 10:23can just go over here
  241. 10:26to our weapon script. Let's say we want
  242. 10:29to disable the or make the hitbox for
  243. 10:31the fist transparent. We can just go
  244. 10:34right here and just say hitbox clone
  245. 10:35transparency is equal to one. And that's
  246. 10:38going to make the transparency for the
  247. 10:40fist hitbox set to one or invisible. So
  248. 10:44if we equipped our fist, you notice that
  249. 10:46we don't have a hit box anymore because
  250. 10:47we made it
  251. 10:51invisible. All right, moving on. We're
  252. 10:54moving back to the script. All right,
  253. 10:55toggle trails function. We went through
  254. 10:57that and we have our change idle
  255. 11:00animation, change run
  256. 11:02animation, which just goes ahead and
  257. 11:05changes our idle and run animation based
  258. 11:06on weapon we have equipped and get dash
  259. 11:09direction should be
  260. 11:12self-explanatory stopping our
  261. 11:15animations. And this is our dash
  262. 11:17function where we play our animation
  263. 11:20from our animations module which is
  264. 11:22right here.
  265. 11:25and we put the sound as well as doing
  266. 11:29dashing
  267. 11:30effects. This is where we do our body
  268. 11:33velocity where the player actually moves
  269. 11:35from the
  270. 11:37dashing. And let's
  271. 11:39see. All right. So, state handler. This
  272. 11:42is how we put we wrap this all in a
  273. 11:45render step method which just updates
  274. 11:49our speed constantly based on what
  275. 11:51statuses we have. And to reiterate from
  276. 11:53a previous video, there's a priority
  277. 11:56system to Roblox, which once again, if
  278. 11:58you recall, Roblox reads things from top
  279. 12:00to bottom. So, if we were to move the
  280. 12:04sprinting status down here, the
  281. 12:06sprinting status will override any of
  282. 12:08the things that we already set up here.
  283. 12:11So, it's important to understand
  284. 12:14uh the priority of each of the statuses.
  285. 12:17So, obviously, stun has a really high
  286. 12:19priority, so it's going to be at the
  287. 12:20bottom.
  288. 12:23And as well as in the state handler in
  289. 12:26the render step, we are constantly
  290. 12:27updating the
  291. 12:29animations. And down here, we're just
  292. 12:32toggling our attacking and sprinting
  293. 12:34trails. And now here is our mobile
  294. 12:37support, which if touch enabled, which
  295. 12:40is if you're on mobile, we're not going
  296. 12:42to do anything for now. But if you are
  297. 12:45on um console, then if you're holding
  298. 12:49button X, you're going to be able to
  299. 12:51attack. Otherwise, it's a normal input.
  300. 12:53If you're on PC, you hold down your left
  301. 12:55mouse button and you
  302. 12:57attack. And as for sprinting, we made it
  303. 12:59to where if you're on PC, you have left
  304. 13:02shift. And if you're either on mobile or
  305. 13:05console, you're just going to
  306. 13:06automatically be able to
  307. 13:08sprint. And blocking. This is our
  308. 13:11blocking all the way here. Which
  309. 13:15similarly to attacking, if you're on
  310. 13:17mobile, the mobile block and attacking
  311. 13:19functions are already handled in our
  312. 13:22controller script right here. But if
  313. 13:25you're on console, then blocking is
  314. 13:27button B. And normally on PC, it's just
  315. 13:32F. And then now finally, let's move on
  316. 13:35to what we did previously, which is our
  317. 13:37controller and mobile compatibility.
  318. 13:41which uh render stepped. So, we want to
  319. 13:44constantly update the visibility of
  320. 13:46either the console or mobile frames
  321. 13:49based on what device you're on. And
  322. 13:52right here is where we start doing our
  323. 13:55mobile attacking, blocking, and things
  324. 13:58of that
  325. 13:59nature. And yeah, that's pretty much it.
  326. 14:03The other thing, well the last thing
  327. 14:04that we did was client effects which we
  328. 14:06cached all
  329. 14:07effects and we
  330. 14:11um we called on the cache modules in the
  331. 14:14on client event method for the clan
  332. 14:18effects. So all in all that's pretty
  333. 14:21much the end of the series. Um I'm going
  334. 14:24to hop in game and just show you the
  335. 14:25comment once again. So, a brief shortcut
  336. 14:29is alt P is for publishing the
  337. 14:33game. All right, now that I am in game,
  338. 14:36this is I'm just going to showcase the
  339. 14:37combo one last time. Let me turn up my
  340. 14:40volume and equip the sword, dagger, and
  341. 14:43fist. So, you notice that when we start
  342. 14:45running, our trails start playing. And
  343. 14:49if we unequipped and equipped, you see
  344. 14:51that trails start playing based on what
  345. 14:53weapon we have equipped.
  346. 14:56Yes, if we dash, you have some
  347. 14:58effects. And now let's hit a
  348. 15:02dummy. And let's set the effects to
  349. 15:04work. And let's equip our fist, which if
  350. 15:06you recall, we disabled the hit box for
  351. 15:10that. You see, it
  352. 15:17works. If we go ahead and clear the
  353. 15:19weapons, you notice all the weapons
  354. 15:21disappear.
  355. 15:23And let's test out the bucking
  356. 15:27dummy. And you'll see that the effects
  357. 15:30work, any
  358. 15:33rebu. And
  359. 15:35yeah, and please leave me any
  360. 15:39suggestions for any series or new
  361. 15:42content that you want that y'all want me
  362. 15:43to post, cuz right now I'm pretty drawn
  363. 15:47on what type of series I want to do for
  364. 15:49y'all. And yeah, put it in the comment
  365. 15:51section.
  366. 15:53So that wraps up the end of this long,
  367. 15:57not not really long, but sort of a 9 10
  368. 16:00episode series for
  369. 16:02uh a basic comment system that you can
  370. 16:04use in a lot of your games. So yeah,
  371. 16:07thank you for watching and once again,
  372. 16:09I'm going to open source this once I hit
  373. 16:11600 subs. So please leave a like,
  374. 16:14comment, and subscribe and thank you for
  375. 16:17watching.

About this transcript

This page contains the full transcript of [Finale] Roblox Combat System for Beginners | Showcase & Fixes by Senko, generated from the public captions YouTube serves with the video. The transcript has 2,430 words across 375 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.