#Is it important to create object values such as "isDashing", "isAttacking" ?

48 messages · Page 1 of 1 (latest)

distant raptor
#

well I think so because that would be a boolean value and lets say you make an animation play when you click the dash button maybe you don't want the player to preform another action that's why the IsDashing could be set to true and you could check if the value for some reason I don't know what you would want but you could 100% do that

#

and for the the object or script part it is up to you but I would just set it as a _G value

#

but remember don't try to add something that is not needed if a debounce is all you need for the script then just write that code

sand raptor
#

it depends

#

if you want to make a complex combat and have high diversity of moves

#

and want a very dynamic movementation and combat

#

you will need those

#

me, for example, in my pvp game

#

I use a number value called "Combo" to count if it's the 1st, 2nd, etc., punch. with that, people can't just do 3 punches, switch to a weapon, and repeat it

#

a bool value called "StartingUp" which is for so you can dash while a certain duration of your move

#

it has to do with the animation in this case too

#

for example, you can dash 0.5 seconds before doing a move called "Earth Toss"

karmic raftBOT
#

studio** You are now Level 8! **studio

sand raptor
#

and also sprint

#

which makes the movementation more dynamic and complex

#

another 0.5 seconds of that move I use the bool value called "Attacking"

#

it's for so you can't use other moves while you're using that one and also so you can't dash for that

#

which is also a nerf for how OP movementation is

#

also, I used to use SetAttribute() to do stuns. trust me: don't do that. with bool values, if there are many attacks coming at you, there can be many stun values inside the character, and you can just do FindFirstChild() do delete them. with attributes, there can't be more than one of the same attribute; I had to make many stun attributes to fix the overlapping issue

#

bool values saved my life for stuns

distant raptor
#

I mean all you have to do is make a bool value assign it as a global var then whenever you want to check if the player is currently in a battle animation or is fighting you could just check it

karmic raftBOT
#

studio** You are now Level 8! **studio

sand raptor
#

you will need a way to manage the mechanics of your game, basically

#

and those aren't only bool values really, but it's the best I found for me

#

mainly because of the stun overlapping issue

distant raptor
#

Or if not comfortable with that you can assign the value to the player in a player joining handler

sand raptor
#

yeah that works too

distant raptor
#

That would be the most efficient instead of an attribute in my opinion but both work

#

And I would put maybe a function in a module script checking for the isattacking or whatever because I would imagine other things may want that information

distant raptor
#

I mean I really don’t use attributes in the first place because you can just organize the code using oop

rugged mirage
#

But thank you for all your help, it will help me a lot for the future, I better understand the importance and the alternatives to bool values

sand raptor
#

there are tags, attributes, values

#

I don't know what more

rugged mirage
#

Rn I have bools values into my script but not into an object. So I can't get these values for another script

sand raptor
#

communicating between different scripts

sand raptor
#

I use FindFirstChild() to, for example, check if a character is stunned before using a move

distant raptor
sand raptor
#

modules too

#

you can do a general table in a module and access it too

#

I used that for like 3 days

rugged mirage