Hw should i handle character combat states

i have my own combat system already and it uses a folder called “status” inside characters to see whats going on with the character

but im wondering if thats bad considering id have to make a new instance every time i wanted to change something

if theres a better way to go about any help on that would be nice

3 Likes

I don’t see much of an issue with the system you’ve proposed - Instance.new() isn’t too expensive, although if states are changing very quickly this might not be the best option. So l’ll give you a couple of things you could do:

  • You could just have a singular stringvalue that contains the state of the player, and that is updated whenever the state needs to be changed.
  • You could have a bunch of boolean values that can flipped on or off for every possible state (although if there’s a lot of possible states this could be tedious)
  • You could use a modulescript in the player with an array inside it that contains the states of the player’s character.

Note that these might not be the best options, as I’ve never really explored this area of ROBLOX programming in-depth. These are just what come to mind when thinking about your issue.

2 Likes

ill try module scriopts as that seems the most fitting

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.