Skills/ability making

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
  • I am looking for how i can go about ability like casting spells organization in terms of where to store the models in my explorer, and if i should use a script containing all of the abilities and to have an event fire accordingly
  1. What is the issue? Include screenshots / videos if possible!
  • im not sure on an efficient way to do this because there can be a ton of abilities
  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
  • none seem to have an answer for me

im sorry if this seems a little bit confusing but, i can elaborate more on it, I was thinking about having a folder full of all the abilities inside the character, and since they will be a model with the different parts and effects being made inside that model, i can just clone it to the workspace and whatnot. however i would like to hear how you guys would handle this. Thank you

3 Likes

I’m actually working on a game right now that has abilities and such.

I don’t use folders or anything like that, I have all my spells in a module script with what is required to “cast” them (See below)
image
The module script is in replicated storage so the client can see the description of the moves (For things like tooltips as well)

Basically, The client calls the module script with the target it wants to hit, The module script has a built in function to see if it’s allowed to hit the target by using checks provided in the screenshot above, If it’s allowed the module script has a built in function for each spell, it runs whatever is in the function and then calls on another module with a table of people I want to be able to see the effects of the move, That module then calls a remote each allowed player and runs a function corresponding to the move that fires the effects for the move they just used.

image
(The check to see if it’s possible to hit target)

2 Likes

So what I tend to do for scenarios like this, is:

Have a special module script with any scripting that the ability may have. And then any effects or parts that the effect may have also included in. I’d then put it all in a folder, within a folder. Let me illustrate.

YourControllingScript
-------------------
   AllAbilities
       FireAbility
           ControllingModule
           Effect1
           Effect2
       PurpleAbility
           ControllingModule
           Effect1
           Effect2

Then I just require the controlling module and input some parameters via a function and run the script, the script then grabs all the items in the same folder and executes what it needs to.

2 Likes

do you have separate scripts for each of the ability?

Yea each folder has a script with its own ability, I rarely have a script bigger than 300 lines.

1 Like