How to make a Roblox JOJO game #2 | Making Stand Combat

SushiMaster
27 Feb 202233:05

Summary

TLDRIn this tutorial video, the creator guides viewers through the process of making a style combat system in Roblox using Lua scripting. The video offers practical tips, such as avoiding the use of 'part.Touched' for hitboxes and not implementing combos on the client-side to prevent exploits. The script includes setting up cooldowns, creating combo animations, and utilizing raycast boxes for precise hit detection. The tutorial also covers adding a combo system with attributes, tweening character movements, and implementing a damage system with hitboxes. The creator promises to continue with sound effects, stand features, knockbacks, and particle effects in the next installment, aiming to provide a comprehensive guide for building an engaging combat experience in Roblox.

Takeaways

  • ๐Ÿ› ๏ธ The video is a tutorial on creating a style combat system in Roblox using Juju series.
  • ๐Ÿšซ Avoid using 'part.Touched' for hitboxes as it can be easily manipulated and is not server-side.
  • ๐Ÿ”„ Do not use client-side combo systems as they can be exploited by resetting the combo.
  • โฑ๏ธ Implement cooldowns for summoning to prevent spamming and ensure fairness in gameplay.
  • ๐Ÿ“Š Use 'os.time()' to track the time passed since a specific action, aiding in cooldown management.
  • ๐Ÿ”„ Create a combo system that resets after a certain number of hits to maintain game balance.
  • ๐ŸŽญ Ensure animations are prepared and named in a specific order to correspond with the combo sequence.
  • ๐Ÿค– Utilize 'AnimationController' for smooth transitions between different combat animations.
  • ๐Ÿ“ก Use server scripts to manage combo logic to prevent client-side manipulation.
  • ๐ŸŽฏ Implement precise hitboxes using 'raycast box' for accurate combat interactions.
  • ๐Ÿ”ง Add attributes to manage whether a character is currently attacking to prevent overlapping animations.

Q & A

  • What is the main topic of the video?

    -The main topic of the video is creating a style combat system in a game development environment, likely Roblox, with a focus on avoiding common mistakes and implementing proper cooldowns and hitboxes.

  • Why should part touch not be used for the hitbox according to the video?

    -Part touch should not be used for the hitbox because it can be easily manipulated by experts to extend the hitbox, which can lead to unfair gameplay where the hitbox can still hit a dummy on the server.

  • What is the reason for not using combos in the local script?

    -Combos should not be used in the local script because it makes them client-sided, which can allow players to exploit the system and create infinite combos by resetting the combo every time.

  • What is the purpose of the 'coco cooldown' variable in the script?

    -The 'coco cooldown' variable is used to implement a cooldown period for summoning, preventing players from repeatedly summoning without any delay.

  • What does 'os.time()' return and how is it used in the script?

    -'os.time()' returns the time in seconds since January 1, 1970. In the script, it is used to calculate the time that has passed since a certain action, like pressing a key, to manage cooldowns.

  • What is the significance of the 'animation' variable in the combat script?

    -The 'animation' variable is crucial as it controls the character's movements and actions during combat. It is loaded from the 'anim' folder and plays a sequence of animations based on the combo system.

  • Why is the 'attacking' attribute used in the script?

    -The 'attacking' attribute is used to check if the character is currently in an attacking state. If the character is attacking, the script will stop to prevent overlapping animations or further actions until the attack is completed.

  • What is the purpose of the 'tween' service in the script?

    -The 'tween' service is used to create smooth transitions between different character positions or animations, such as moving the character's stand forward or backward during combat.

  • Why is the 'raycast box' preferred over 'part.touch' or 'magnitude' for hitboxes in this tutorial?

    -The 'raycast box' is preferred because it offers more precision for hit detection compared to 'part.touch' or 'magnitude'. It allows for a more accurate representation of where the hit occurs.

  • How does the script handle the cooldown after the fifth combo?

    -The script includes a task delay for one second after the fifth combo is executed. This pause ensures that there is a cooldown period before the player can continue with another combo.

  • What is the final step in the script related to the hitbox?

    -The final step in the script related to the hitbox is to create the hitbox using 'module.castmore' with the appropriate parts table indexed by the combo, and then handling the hit detection with the 'hitbox.onHit' event.

Outlines

00:00

๐Ÿ› ๏ธ Combat Scripting Tips and Cooldown Implementation

The video begins with the host offering advice on creating a combat script in a game development environment, likely Roblox's Lua-based system. The first tip is to avoid using 'part.Touched' for hitboxes due to its vulnerability to manipulation. The second tip is to refrain from creating client-side combos to prevent exploits. The host then demonstrates how to implement a cooldown system for summoning abilities, using a variable 'cocoa cooldown' set at 0.7 seconds and a table for player cooldowns. The concept of 'always time' is introduced as the time elapsed since January 1, 1970, and is used to calculate the time passed since the last ability use. The script checks if the current time minus the last ability use time is greater than or equal to the cooldown, allowing the ability to be used again.

05:02

๐ŸŽญ Setting Up Animation and Combat Script Basics

The host proceeds to guide viewers through setting up animations for a combat script, ensuring that animations are named in the correct order and placed in designated folders. A 'combat client' script is created, and a remote event is set up for combat commands. The script listens for mouse clicks and initiates a combo system using attributes to track the combo count. A function named 'combo changer' is implemented to increment and reset the combo count based on the maximum allowed combo size. The animations are tested to ensure they play correctly, and an issue with overlapping animations is addressed by introducing a cooldown attribute to prevent spamming.

10:02

๐Ÿ”„ Animation Tweaks and Cooldown Mechanic

The host discusses an issue with animation overlapping when the attack key (M1) is spammed and introduces a solution involving a 'character set attribute attacking' to prevent the script from running while an attack is in progress. The script is designed to stop once the current animation ends, as detected by the 'animation ended' event. The host also introduces a 'tweening' service to move the character's stand forward and backward, with adjustments made to ensure smooth transitions between animations. A delay is added to allow the player to stop pressing the attack key, and only then does the stand move backward.

15:05

๐Ÿ’ฅ Adding Hitstun and Cooldown After Combo

The script is enhanced to include a hitstun effect after a combo sequence, with an attribute 'attacking' used to check if the character is in a hitstun state. If the character stops attacking, the stand moves backward. An 'else if' statement is added to handle the transition after the maximum combo is reached. A cooldown is introduced after the fifth combo, causing the script to wait for one second before continuing. The character's walk speed is also adjusted during this cooldown, and a humanoid variable is created to manage the character's speed during combat.

20:06

โš”๏ธ Implementing Raycast Box for Precise Hitboxes

The host opts for a 'raycast box' over 'part.Touched' or 'magnitude' for more precise hitboxes. The process involves creating a hitbox using attachments named 'damage point' and starting the hitbox with a variable. The hit detection is managed through an event that triggers when the hitbox makes contact with a character. The hitbox is then stopped using a specific command. The host also explains how to make the hitbox ignore the player's character and provides a visual representation of what the hitbox will look like.

25:10

๐ŸŽฏ Fine-Tuning Hitboxes and Animation Sync

The host demonstrates how to create damage points for each body part involved in the animations and how to attach them to the character. A part table is created to reference the correct body part for each combo move. The hitbox is started using a module and the part table is indexed with the current combo number. An event is connected to handle hit detection, and damage is dealt to the enemy humanoid. The script is tested, and adjustments are made to ensure the hitbox stops correctly after the animation ends. The host also addresses a potential issue with Roblox failing to load assets and turns off the hitbox visualizer for a cleaner look.

30:14

๐Ÿ”š Final Touches and Upcoming Tutorial Preview

The host wraps up the tutorial by turning off the hitbox visualizer and making the humanoid part invisible for aesthetics. The script is modified to reset the combo if the player stops attacking after a short period, mimicking a mechanic from the game YBA (Yugioh: Battle City). The host also comments out unnecessary print statements to clean up the script. The video concludes with a preview of the next tutorial, which will cover adding sound effects, stands, knockbacks, and possibly particles for the head effect.

Mindmap

Keywords

๐Ÿ’กHitbox

A hitbox in video game development refers to an invisible shape that is used to detect collisions between objects. In the context of this video, the creator is discussing how to properly implement hitboxes for a combat system in a game, emphasizing the importance of not using 'part.touch' for hitboxes as it can be easily exploited. The script mentions using 'raycast box' for more precise hit detection, which is a technique that involves casting rays or lines from the hitbox to detect if they intersect with other objects.

๐Ÿ’กCooldown

A cooldown is a period of time during which a character or ability cannot be used again after it has been activated. In the video, the creator is implementing a cooldown feature for a summoning ability, which is set to 0.7 seconds. The cooldown is crucial for balancing gameplay, preventing players from overusing powerful abilities and ensuring a fair and strategic combat system.

๐Ÿ’กCombo

A combo, short for combination, is a sequence of moves or actions performed in quick succession, often in fighting games. The video script describes creating a combo system where the player can execute a series of animations in order. The creator warns against implementing combos on the client-side to prevent exploits and demonstrates how to increment and reset the combo counter based on player inputs.

๐Ÿ’กAnimation Controller

An animation controller is a component used in game development to manage and switch between different animations of a character or object. In the script, the creator mentions using a standard animation controller to handle the character's movements and attacks, ensuring that the animations play back smoothly and in the correct order.

๐Ÿ’กTweening

Tweening is the process of creating an animation by interpolating between two states. In the video, the term is used in the context of moving the character's stand (a companion character in the game) forward and backward. The creator uses a tweening service to smoothly transition the stand's position over a certain duration, enhancing the visual fluidity of the combat moves.

๐Ÿ’กRaycast

A raycast is a line that extends from a point in a certain direction, used to detect if it intersects with other objects in the game world. The script discusses using 'raycast box' for hitboxes, which involves casting rays from various points on the character's body to determine if an attack connects with an opponent. This method provides a more accurate hit detection compared to simpler collision methods.

๐Ÿ’กScripting

Scripting in the context of this video refers to writing code to implement game mechanics. The creator is scripting various aspects of the combat system, including hitboxes, cooldowns, and combo systems. The script mentions using conditional statements, loops, and event handlers to control the flow of actions and responses in the game.

๐Ÿ’กAttributes

In game development, attributes are properties or characteristics of game objects, such as health, speed, or attack power. The video script describes using attributes to track the state of the character, such as whether they are currently attacking or the current combo number. These attributes are essential for managing the character's behavior and interactions within the game.

๐Ÿ’กRemote Event

A remote event is a method of communication between the server and clients in a multiplayer game. It allows the server to trigger events or functions on the client's side. In the script, the creator sets up a remote event called 'combat' to handle input from the player and execute the corresponding combat actions on the server, ensuring consistency and fairness in the game.

๐Ÿ’กInput Handling

Input handling is the process of detecting and responding to player inputs, such as mouse clicks or key presses. The video script discusses setting up input handling to detect when a player initiates a combo by clicking the mouse. Proper input handling is crucial for creating responsive and interactive gameplay experiences.

๐Ÿ’กGame Balancing

Game balancing involves adjusting game mechanics to ensure a fair and enjoyable experience for players. In the video, the creator discusses implementing cooldowns and limiting the combo system to prevent overpowered strategies. Balancing is an important aspect of game development that the creator is considering while building the combat system.

Highlights

Avoid using 'part.Touched' for hitboxes as it can be easily manipulated by experts to extend hitboxes.

Do not make combo systems client-sided to prevent infinite combos by resetting the combo.

Implementing a cooldown system for summoning to prevent spamming.

Using 'os.time()' to keep track of time passed for cooldowns.

Creating a 'cocoa_cooldown' variable for managing summoning cooldowns.

Using 'playerCooldowns' table to store individual player cooldowns.

Explanation of 'always_time' and its role in cooldown calculations.

Creating a combo system using attributes and a 'combo' attribute for tracking.

Introducing a function 'comboChanger' to manage combo progression.

Adding a cooldown to prevent animation overlapping during combo execution.

Utilizing 'tween service' for smooth stand movement during combat.

Creating hitboxes with 'raycast box' for precise combat interactions.

Using 'hitbox.onHit' event to handle damage and effects when a hit is detected.

Incorporate 'raycastParams' to ensure hitboxes ignore the player's own character.

Adding a mechanism to reset combos if the player stops attacking after a period.

Adjusting humanoid walk speed during combat for realistic movement.

Upcoming tutorial content will include sound effects, stand additions, knockbacks, and particle effects.

Transcripts

play00:00

hello guys welcome to my juju series and

play00:02

today we're gonna be making style combat

play00:04

before i start this video i'm gonna give

play00:06

you some tips um so the first step is do

play00:10

not use parts part attached for the

play00:12

hitbox i use i'm seeing a lot of

play00:14

youtubers use part the touch for the

play00:17

hitbox

play00:18

never do that because

play00:20

using partner touch and welding into our

play00:22

character which means it's easily

play00:24

explainable

play00:25

and

play00:26

that means if i'm i'm an expert i can

play00:29

just extend the hitbox

play00:31

and it'll still hit the

play00:33

dummy on the server which sucks you

play00:36

don't want that that's

play00:38

really it doesn't feel and

play00:41

my second tip is do not when you're

play00:43

making a combo script like when you're

play00:45

making a

play00:46

combo system do not use combos in the

play00:50

local script do not use commerce um

play00:52

client-sided

play00:54

not make the combo available in the

play00:55

client because explorers can just

play00:58

um infinite combo you by resetting the

play01:01

combo every time okay that sucks

play01:04

so

play01:05

first of all i'm gonna add in the

play01:07

cooldown for summoning and summoning

play01:09

as you can see i don't found this

play01:11

so let's add in the cooldown okay

play01:16

so for our cooldown let's make a

play01:17

variable called cocoa cooldown we're

play01:20

going to make this 0.7 seconds

play01:22

and let's add in a table for

play01:25

the player cooldowns for the player that

play01:27

that cooldown okay

play01:29

and let's do something like this

play01:32

clear cooldowns

play01:34

and print locator

play01:37

in the index um a close

play01:39

west.time

play01:41

okay so if you're wondering what always

play01:43

the time is you don't know what else the

play01:44

time is

play01:45

always the time is the time that's

play01:48

passed since

play01:49

one january 1970. it returns in seconds

play01:53

let's go right here so you may be

play01:55

wondering how are we going to use this

play01:57

for our cooldown so what we're going to

play01:59

do is we save this oyster time

play02:01

and we're going to subtract the current

play02:04

time the current oyster time

play02:05

with

play02:06

our

play02:08

clear cooldowns

play02:10

character

play02:11

right

play02:12

and

play02:13

there is um and the result will be

play02:16

the time that's passed since we pressed

play02:18

q

play02:19

alright

play02:20

now let's do this real quick let's add

play02:22

in scripts

play02:24

if

play02:26

player cooldowns character if we have a

play02:28

cooldown on if the cooldown is on

play02:30

then

play02:32

all right and then we're gonna check

play02:33

some like this and then we're gonna do

play02:34

some of this what if where's the time

play02:36

the current oso time

play02:38

subtracted with player cooldowns

play02:40

character

play02:42

is bigger or equals cooldown

play02:46

then we're gonna remove our character

play02:49

from the cooldown

play02:51

table

play02:52

equals no

play02:54

else

play02:55

oops else

play02:57

return

play02:58

else turn end

play03:00

all right so let's say the o is the time

play03:03

the current is the time is seven seconds

play03:05

and then our player cooldowns character

play03:07

is five seconds which means if we

play03:10

subtract seven with five

play03:13

and then we're going to get two the

play03:14

number two is the time that's passed

play03:17

since we used the summon function

play03:20

then we're going to check if the summon

play03:22

if the

play03:23

two seconds is bigger or equals the

play03:26

cooldown then

play03:28

it's going to remove the character and

play03:29

it's going to contain the script and

play03:31

then let's do the same thing

play03:33

for our club and function

play03:37

right

play03:38

let's test this out

play03:41

see it works okay

play03:42

the cooldown exists okay now

play03:45

now we're gonna be making

play03:47

the combat script let's close out of

play03:49

this

play03:50

so make sure to get your animation ready

play03:51

i got my animation ready right here put

play03:54

your animations inside of

play03:57

the anim folder hold on let me rename

play03:59

this to one

play04:01

two three four five okay

play04:04

make sure you've renamed your animations

play04:06

to your combo order

play04:07

and let's put this

play04:09

inside of your stand hold on understand

play04:13

storage stand

play04:15

oops oh my god

play04:19

put this inside of

play04:21

the spam folder

play04:24

and let's make a let's make a folder

play04:26

called moose called make rename it to

play04:29

moose since in a different video in the

play04:32

future video we're gonna be putting

play04:35

we're gonna be making moves at and we're

play04:37

gonna be putting the local scripts

play04:38

inside of this folder

play04:40

and then let's rename this to

play04:43

combat client

play04:45

let's add a let's add a remote event you

play04:48

know the drill

play04:49

rename this to combat

play04:52

combat yeah let's say this combat unless

play04:54

adding a silver script script

play04:58

combat script

play05:01

all right

play05:02

now let's do some of this you know the

play05:04

drill game dot

play05:06

get give me a service using the service

play05:09

when you detect the inputs uh the inputs

play05:11

remotely required storage for child

play05:14

combat

play05:16

service dot input again connect function

play05:20

key typing

play05:22

let's add in i've typed in first

play05:26

and instead of key and

play05:31

and instead of keto t code we're going

play05:33

to do e dot user input type

play05:35

because it was adam

play05:37

dot user of the type

play05:39

dot most one since we're gonna be

play05:41

checking if the character clicks the

play05:42

mouse or not

play05:43

then the mode fires over

play05:46

that's it we don't need to touch this

play05:47

anymore

play05:48

and

play05:50

now we're gonna

play05:51

um

play05:52

do our server script

play05:54

convert server

play05:56

so for our combos we're gonna be

play05:58

using um

play06:00

attributes

play06:02

okay but let's add

play06:05

don't in a

play06:05

edit event

play06:06

click edit connect function

play06:09

run the player here another character

play06:10

added if the character is added

play06:14

inside of the workspace

play06:15

red connect function

play06:18

put in our character uh parameter

play06:21

character

play06:22

so that's reset attribute is to create

play06:24

an attribute or to add an attribute

play06:26

putting the string name i'm going to

play06:28

name this combo and the value just one

play06:32

and then let's create a remote event

play06:33

variable remote equals

play06:36

game programmable storage wait for child

play06:39

remote event alone

play06:41

combat it's called command media

play06:44

what dot on server event connect

play06:46

function

play06:49

player button player here

play06:51

local character equals player dot

play06:54

character

play06:57

local stand equals character dot stand

play07:01

local animation controller local

play07:03

controller

play07:05

controller

play07:06

a cool standard animation controller

play07:11

local standard parts then underscore

play07:15

equals

play07:16

dyna primary part we're going to be

play07:18

we're making the variables right now

play07:20

primary parts

play07:22

and develop local build it will stand

play07:25

dot fill

play07:28

all right now let's make uh let's um add

play07:32

in uh let's uh make the

play07:34

animation variable

play07:36

let's do this

play07:40

local atoms equals stand dot atoms it's

play07:45

called atom's regime

play07:47

and then we're going to start with this

play07:48

local

play07:49

current animation current animal

play07:52

equals

play07:53

controller

play07:55

load animation

play07:59

and the anims

play08:01

and we're gonna put in and we're gonna

play08:04

put in

play08:05

the index and it's gonna be our combo

play08:08

since let's say

play08:09

we're planting two times then our combo

play08:11

is two which means we're going to play

play08:13

the second animation the first pad to

play08:15

make a combo after a variable go to

play08:17

combo equals character gradually combo

play08:20

get attribute gets to be asked where it

play08:22

gets the value okay so that actually

play08:24

resets the attribute anonymous combo

play08:28

now that we've done this we're going to

play08:29

make a function

play08:31

to change the combo local function

play08:35

combo changer

play08:39

um

play08:40

my uh put in our character and the congo

play08:43

as a

play08:44

render

play08:47

and let's just move this if combo

play08:50

is smaller than five five is my max

play08:54

combo

play08:55

if your maximum blue is four then put in

play08:57

four or three and so on and so forth

play09:00

then

play09:02

character

play09:03

set attribute

play09:06

combo

play09:09

combo

play09:11

and we're gonna increase the combo by

play09:13

one

play09:14

and if the combo is five

play09:17

okay the nice combo we're gonna reset

play09:19

the combo back to one

play09:23

like that's nice that's nice

play09:26

okay change combo changer character

play09:30

and combo

play09:31

primary parts oh yeah yeah i

play09:34

accidentally added an s

play09:36

misspell oh yeah i forgot to leave the

play09:38

animation my bad my bad

play09:40

my bad guys my bad

play09:42

my fault my fault

play09:44

current and i'm play

play09:47

there we go

play09:53

all right the animations work

play09:55

that's nice that's really nice okay

play09:58

so

play10:00

yeah that's cool that's really cool

play10:02

and

play10:03

but but uh the anime when you spam m1

play10:06

the animation is overlapping so that's

play10:08

why we're going to add in a cooldown

play10:10

let's add in an attribute called

play10:13

character set attribute attacking

play10:16

then we're going to check if the

play10:18

character is attacking or not local

play10:19

attacking

play10:21

both character gets rid of attacking

play10:22

which is which gets the value

play10:25

and if the character is attacking then

play10:27

it's going to stop the script

play10:29

okay and then

play10:30

return end

play10:32

all right so

play10:34

hey once the current animation is

play10:36

over right we're gonna select this

play10:38

current animation

play10:39

dot ended yeah i'm pretty sure it's

play10:41

called um i'm pretty sure the event is

play10:43

called let me find out nice call dot

play10:45

stop my bad

play10:47

dot stop

play10:48

connect function so when your animation

play10:51

is over

play10:52

um it's gonna

play10:54

set the attribute back to

play10:57

set the attacking aspect back to nail

play11:00

which destroys the attribute

play11:02

all right

play11:03

so in my preview series the combat

play11:05

release i used task delay

play11:08

and then the duration of my animation

play11:10

instead of animation that stopped i

play11:12

recently found out about this this is a

play11:14

really cool mechanic oh i forgot to put

play11:16

in the value

play11:17

let's see if it's working again or not

play11:22

right

play11:23

let's see if this works i'm spamming

play11:26

ammo right now yeah alright so now we're

play11:28

gonna tween

play11:29

the stand forward okay

play11:32

so let's um add in

play11:35

my twin service

play11:38

so let's require my twin service module

play11:42

game

play11:44

cool choir game for replicated storage

play11:47

dot printer this v2

play11:48

i'm going to put this above the barrel

play11:51

motor event

play11:52

and let's

play11:54

do somewhere i guess so yeah yeah okay

play11:58

all right

play12:00

or so it hides the

play12:03

creative added uh event all right

play12:06

actually let's make the twin info first

play12:08

local info equals twin info dot new

play12:13

the duration will be 0.13 seconds

play12:16

okay and i'm not even you can change it

play12:18

to whatever you want um for me i'm going

play12:20

to change i'm going to put this 2.13

play12:22

seconds go on and i'm done using

play12:24

direction

play12:25

using direction dot out

play12:30

right

play12:32

let's uh do something like this oh ts

play12:34

create

play12:40

let's put this

play12:42

yeah let's put this below this ts

play12:45

getting object the instance which is the

play12:48

weld the inhale which is

play12:51

info and the goal

play12:53

we're gonna change the c1

play12:56

to

play12:58

to make the we're gonna change the

play12:59

offset to make the stat in front of us

play13:01

see frame dot new

play13:03

zero zero one i think that's the right c

play13:06

frame

play13:07

all right

play13:08

and then let's play

play13:10

this animation i'm i'm in between not

play13:12

anything my bad

play13:16

all right

play13:17

let's see if this twins will work okay

play13:19

it works

play13:24

now i'm gonna make it twin backwards

play13:27

so turn it to the original position

play13:31

so now we're gonna do something like

play13:32

this

play13:35

ps

play13:36

getting object

play13:39

weld

play13:40

the info

play13:41

and

play13:42

the go

play13:44

which is um

play13:47

c one

play13:48

c frame dot new we're gonna change this

play13:51

to the original

play13:54

stand summoning offset which is

play13:59

uh which is two minus one and minus two

play14:03

two minus one and minus two

play14:06

let's play this play

play14:08

right

play14:12

let's play

play14:17

all right right

play14:18

it's understand

play14:21

it's going to turn backwards but the

play14:23

thing is when you spam click it's going

play14:25

to be jittery i want it to be like yba

play14:27

right when i keep on running when i

play14:29

don't stop my morning the stance won't

play14:31

be between backwards but when i stop m1

play14:35

the stand will be twin backward

play14:37

right

play14:38

so to do this we're gonna need to give

play14:42

um

play14:43

the player

play14:44

a chance

play14:46

um to

play14:47

m1 again

play14:49

let's wait point five seconds i mean

play14:51

point three seconds function using

play14:53

tacitly you already know what times the

play14:55

delay is

play14:57

so it's going to give the player a

play14:58

chance to m1 again right and it's

play15:01

so the chance is 0.3 seconds you can

play15:04

make this shortest shorter if you want

play15:07

so

play15:08

it's gonna check if the character is

play15:11

still embodying or not by doing

play15:12

something like this character

play15:16

okay attribute

play15:18

combo

play15:20

minus one

play15:22

minus one by why did i do the minus one

play15:25

here well it's because the combo is

play15:29

is always bigger i mean the get

play15:31

attribute combo is always bigger than

play15:34

the combo variable because

play15:36

um the combo is the combo variable is

play15:38

like the current combo and the

play15:41

combo attribute is like the future combo

play15:44

okay

play15:45

so that's why we're gonna do minus one

play15:49

it's character garage combo minus one

play15:52

is still the same

play15:54

as combo

play15:56

that means that the character stopped

play15:59

and wanting

play16:00

then

play16:02

so by doing this it's going to check if

play16:05

the characters stop them wanting or not

play16:07

if the character is

play16:10

if the character is not emoting anymore

play16:12

then it's gonna tween the stand

play16:14

backwards but if it's still a morning

play16:17

then the stand won't be tweened

play16:20

backwards let's see

play16:23

let's check

play16:24

one two and then i stop and running and

play16:27

then it's gonna get backwards but the

play16:29

thing is if i do this

play16:31

on the fifth combo three four five it's

play16:35

not going to get pinned backwards the

play16:37

fifth cambodian got twin back because

play16:40

um

play16:41

my combo is five it's gonna get reset to

play16:43

one so one minus one equals equals zero

play16:46

right and

play16:48

zero is not the same as five since

play16:52

my previous combo is five so that's why

play16:54

we're gonna add an else if statement

play16:57

else if combo is five

play17:00

then it's gonna get twinned back

play17:06

so let's see if this works

play17:16

one two

play17:18

three four five it's gonna get spin back

play17:21

one two three i stop i'm running it's

play17:23

gonna get to be back if i don't stop and

play17:25

warning then it's not gonna get changed

play17:26

back it's only gonna get twin back if i

play17:28

stop my money i don't see any other

play17:30

tutorials do this all right now that

play17:32

this is done

play17:34

we're gonna uh add in and like

play17:37

so that there's a cooldown at the fifth

play17:39

and one

play17:40

to do this we're gonna do something like

play17:42

this

play17:43

if

play17:44

combo equals equals five

play17:48

then

play17:50

task

play17:51

dot wait

play17:53

one so when my combo is five it's gonna

play17:55

wait one second

play17:57

and then it's gonna continue the script

play18:00

and then let's change my human rate

play18:02

speed

play18:03

hold on let's add in let's make

play18:05

and then let's change my walk speed to

play18:07

five

play18:08

so hold on hold on

play18:11

let me add in my humor

play18:13

variable let me add another unit

play18:14

variable

play18:17

low correction might

play18:20

humanoid equals character

play18:23

dot humanoid

play18:26

so first of all let's save the unit walk

play18:29

speed

play18:31

and

play18:34

old speed

play18:36

equals

play18:37

humanoid lock speed

play18:39

vocal speed

play18:43

right log speed so it's gonna see the

play18:45

speed let's say my speed was already

play18:47

seven

play18:49

and then

play18:50

i

play18:51

wait one second and then it's gonna

play18:53

return my speed back to seven instead of

play18:55

sixteen

play18:56

which is good okay

play18:58

what's speed

play19:00

equals

play19:02

old speed

play19:04

oh yeah i've got to change my lock speed

play19:07

you know hold

play19:08

on put and change your walk speed after

play19:12

you do the old speed

play19:14

after you um save the old speed

play19:17

equals five you can change my lock speed

play19:19

to five

play19:22

and then the unlock should work

play19:30

all right i spent my one

play19:34

i'm spamming m1

play19:36

and there's a cooldown

play19:39

see

play19:40

there's the gold on

play19:42

after the fifth one which is good

play19:49

so we've done the twinning the end leg

play19:52

and the combo now we're gonna

play19:55

do the hitbox which is

play19:57

the fun part so for the hitbox we're not

play20:00

gonna be using part.touch that sucks

play20:03

nor magnitude that's pretty good but

play20:05

we're going to be using

play20:07

raycast box since i want my hitbox to be

play20:10

way more precise

play20:12

than magnitude

play20:16

all right this is the rake acid box

play20:18

therefore so this is how

play20:22

um curricular box works so you create

play20:25

the hitbox using the using attachments

play20:28

and then renaming it to damage point

play20:31

and to start the hitbox you need to

play20:33

create a hitbox variable

play20:34

right has hitbox.new you put in the part

play20:37

that then of your hitbox that has the

play20:40

damage points and then to start the

play20:41

hitbox use hit start

play20:43

okay so it'll look like this

play20:47

and

play20:48

for hit detection we're gonna there's an

play20:50

event called the unhit there are two

play20:52

parameters the hit and the humanoid

play20:55

uh

play20:56

you can do something like this yeah yeah

play20:58

and then

play21:00

you can stop the

play21:02

stop the hitbox by using no hitbox hit

play21:05

stop okay

play21:08

and then you can make it ignore your

play21:09

character by changing the raycast ramps

play21:13

also if you don't know

play21:16

what the

play21:17

hitbox will be like it'll look like this

play21:21

it's a pretty accurate box

play21:23

okay so that's scripted now

play21:26

let's put in the hitbox here okay box

play21:30

box

play21:33

box before

play21:39

put this in

play21:41

server storage and then i'm gonna make a

play21:43

folder for modules

play21:45

folder

play21:46

since we're definitely gonna be using

play21:47

what uh more than one module i can

play21:50

say that for certain

play21:52

so

play21:54

like the tutorial we're gonna be making

play21:55

the damage points so my animation combo

play21:59

animation uses every single body part

play22:01

that's why i'm gonna be

play22:04

adding the damage points on every single

play22:06

um arms on every single limbs

play22:09

and then we're gonna

play22:11

add in

play22:13

the attachments

play22:14

and then i'm gonna make it visible

play22:16

visible

play22:18

but that's it

play22:19

and then rename it to

play22:21

damage point

play22:22

i'm gonna jump cut to when i've made all

play22:26

of my damage points okay all right i'm

play22:28

done with my damage points do not copy

play22:30

my damage points with me i make this um

play22:34

damage points

play22:35

solely for my animation since we're not

play22:38

gonna be using the same animations make

play22:40

your damage points

play22:42

um fit

play22:43

to your animations not my animations do

play22:46

not copy mine

play22:48

okay go to your camera script and

play22:50

require the

play23:18

and now we're gonna create the hitbox

play23:23

by doing something like this

play23:28

locally box

play23:30

equals

play23:34

module.net remodel.new

play23:37

and put in the part okay so

play23:40

before we put in the part we need to

play23:41

make a part table all right

play23:46

while you're doing something like this

play23:50

parts equals

play23:53

so

play23:54

in my animation

play24:01

my first punch

play24:03

uses

play24:04

my right arm

play24:06

so that's why

play24:07

i'm gonna make my

play24:10

um

play24:11

first value stand

play24:13

right arm

play24:15

oh yeah putting

play24:16

your stand back to its original position

play24:19

back to its original place

play24:21

service image

play24:24

okay okay

play24:26

let's switch

play24:30

come on man

play24:32

surf storage

play24:37

surface storage there we go

play24:40

right

play24:42

i use the right leg

play24:48

and

play24:49

come on

play24:50

stand

play24:53

and right left left leg my back

play24:56

right

play24:58

right and then

play24:59

left arm

play25:02

left arm

play25:09

let's check if it's true my fourth

play25:12

animation uses

play25:15

all right and right leg and it should it

play25:17

should the five animation should be the

play25:19

left arc okay

play25:21

do this but use your

play25:23

animations

play25:24

body parts okay

play25:26

i'm gonna copy this

play25:29

so i made this in order

play25:31

of the combo so we can just do something

play25:34

like this

play25:36

new

play25:38

the parts parts table and then index it

play25:41

with our combo

play25:43

that's cool that's cool

play25:45

let's start the combo and let's start

play25:47

the

play25:48

box

play25:52

hitbox

play25:54

it starts to start a box you use it

play25:56

start

play26:01

all right all right

play26:04

now

play26:06

there is an event called

play26:09

bro what's up with this

play26:13

oh my bad

play26:17

this shouldn't be

play26:18

what you know go hit box

play26:24

local hitbox equals

play26:29

module

play26:31

three module i guess

play26:34

cast more

play26:37

row mod

play26:37

module okay hitting modules.new

play26:40

and the parts table

play26:42

put in our an index

play26:44

and exit using our combo

play26:48

and let's add in an event called

play26:52

hitbox.on head

play26:55

connect function

play26:56

there are two parameters the hit and the

play26:59

humongo

play27:00

we're gonna

play27:03

make the hearing oh okay let's change it

play27:05

to ehome instead of human

play27:08

since

play27:09

we already have a human uh variable

play27:13

icham which means enemy humate by the

play27:15

way like damage

play27:17

i'm gonna make yeah i make it i'm gonna

play27:19

make it do like 10 damage

play27:22

seven damage okay that's fine

play27:24

and

play27:26

then we're gonna stop the script once

play27:31

the animation once the animation is over

play27:35

we're doing this

play27:38

hitbox

play27:41

hitbox

play27:45

hit

play27:46

box hit stop

play27:49

do not put this below here by the way

play27:51

since it uses task dot wait

play27:54

uh if you put this below here then when

play27:56

your combo is five it's gonna wait one

play27:58

second before your right box will stop

play28:01

okay

play28:02

let's hope

play28:03

this script works i hope this trick

play28:05

works please work this one face words

play28:08

work

play28:11

it's been like 28 minutes

play28:14

but i don't want to fix any errors

play28:17

yo it works

play28:20

look at this

play28:21

it works yo

play28:25

oh yeah oh yeah it is my character oh

play28:27

yeah

play28:32

so that's why we're going to be making

play28:33

an economist by using raycast rams

play28:37

okay

play28:38

uh

play28:40

local

play28:42

local programs equals raycast programs

play28:44

dot new

play28:47

params.filtertype so we're gonna change

play28:49

the filter type to blacklist

play28:51

i just filter type.blacklist

play28:54

and

play28:55

we're gonna do

play28:56

params dot

play28:58

param dot filter descendant instances

play29:01

equals our character so it's gonna

play29:03

blacklist our character so it's gonna

play29:04

ignore our picture okay

play29:06

and we're gonna change the hitbox

play29:09

rayguest params to our params cast

play29:12

request rams equals price this should

play29:14

work now

play29:15

this will work

play29:18

i hope

play29:25

all right

play29:26

let's see if this works

play29:28

boom boom boom boom boom um the

play29:31

animation is a bit slow at first because

play29:33

it's loading in the animation

play29:37

yo this is cool as well

play29:39

this is really cool oh yeah wait wait do

play29:40

you guys have the same problem with me

play29:42

where roblox rio failed to load some

play29:44

stuff sometimes

play29:46

since this time um

play29:48

my hat isn't loaded and my monkey face

play29:50

isn't loaded

play29:51

let's check oh yeah yeah it also isn't

play29:53

loaded in the server i don't know why

play29:54

he's doing this oh yeah let me turn off

play29:57

uh

play30:00

turn off damage points visibility the

play30:02

attachment visibility

play30:04

since it's distracting also why do i

play30:06

have two torsos that's so stupid let's

play30:09

delete this you only need one torso

play30:14

and let me turn off the visual the

play30:16

visibility real quick all right so now

play30:18

we're gonna do two things we're gonna

play30:20

turn off the hitbox visualizer the red

play30:22

the red lines

play30:24

and we're gonna make our humanoid part

play30:27

invisible since it's visible right now

play30:30

as you can see hold on it looks really

play30:32

ugly

play30:33

it looks really janky

play30:35

but first let's turn out the visualizer

play30:37

it's really simple let's do something

play30:39

like this

play30:40

dot visualizer equal sounds and then for

play30:44

the

play30:45

summon script

play30:48

do something like this

play30:50

where is my okay there it is

play30:52

and check if

play30:54

the part is not our stand primary part

play30:58

or part then it's gonna change the

play31:00

transparency to zero

play31:03

all right let me test it out

play31:07

this works woohoo

play31:09

let's see for my let's see my hammers

play31:11

yeah the red lines is off

play31:13

that's nice

play31:14

all right now i want to remove these

play31:17

prints because it's so annoying so just

play31:19

click on these prints and then comment

play31:22

this out okay comment down

play31:25

that's all i need to do and then the

play31:27

second thing i want to do is i want to

play31:29

make it so my combo can reset if i stop

play31:32

and running after a while

play31:34

so

play31:35

to that we're going to do something like

play31:36

this

play31:37

go to our combo changer function

play31:40

in here

play31:42

do something like this

play31:44

task dot delay

play31:47

we're gonna

play31:48

um put one once again

play31:51

function

play31:52

we're gonna check

play31:53

if

play31:54

character

play31:56

get attribute

play31:59

combo

play32:01

-1

play32:02

is the same as combo

play32:05

then

play32:06

it's gonna change the attribute

play32:08

back to one

play32:10

combo

play32:11

one so

play32:12

if my combo is smaller than five i'm

play32:15

going to increase my combo by one and

play32:17

i'm going to wait one second

play32:18

using task totally and check if

play32:22

my

play32:23

character combo isn't increasing

play32:25

so if my combo is not increasing then

play32:28

it's gonna reset the combo back to one

play32:30

like yba since i'm basing the tutorial

play32:33

on yb i really like yba

play32:36

this

play32:37

one two three i'll wait one second

play32:40

then i can do one two three again so

play32:45

this is it for my video the next video

play32:47

will be about finishing the combat i'm

play32:50

gonna add in sound effects i'm gonna add

play32:52

in stands adding knockbacks

play32:54

and i'm gonna be um

play32:58

i might be adding particles for the head

play33:00

effect you know thank you for watching

play33:02

and i'll see you next time goodbye

Rate This
โ˜…
โ˜…
โ˜…
โ˜…
โ˜…

5.0 / 5 (0 votes)

Related Tags
Roblox ScriptingLua TutorialCombat SystemGame DevelopmentHitbox MechanicsAnimation ComboCooldown SystemRaycast BoxCharacter CustomizationScript Optimization