Abilties and models

my game in the future will have +100 models every 1 out of 3 charactes will have unique ability the others will have the same but with different animations
now i wonder where to put these scripts that contains the abilities and how do i copy them to the charactees

  • can anyone tell me whats the approximatly number of models that i can create like the limit to not cause the server to crash
3 Likes

Store abilities in modules

I dont really see any problem with models unless its high on Tris count

3 Likes

This is how I’d do it:

  1. You can use ModuleScript for each ability type (AOE, Single, etc.), this simply contains the VFX to play abilities locally per player.

  2. You can then reference to these abilities from a separate ModuleScript, where you store characters. This ModuleScript references all abilities per character, so you don’t have to write duplicate code when characters share an ability. For example, when a player fires ability 1, the server has to check what character the player has and then fire an event to all clients and play the ability VFX (from step 1).

  3. The server uses a separate ModuleScript for ability hitboxes, this can be on either the server or the client. If it’s on the client, the server temporarily listens to the player who invoked the ability. If the player hits something (you can do hit detection from a separate ModuleScript within the VFX ModuleScript), it lets the server know and the server does sanity checks to see whether a hit was actually possible.

This was a framework in a nutshell. I’m not on pc right now so I can’t provide code, but there are many tutorials with similar frameworks on this.

6 Likes

but every abillity will be nearly different from the other i think it will be too much for a single script can u give me anothrr idea pls :slight_smile:

2 Likes

Giorgi331’s explanation is perfect as-is, but if you want the abilities to be in many different scripts you can have many different ModuleScripts as children of the main Ability ModuleScript and require them all using script:GetChildren(). Then you can use the Ability Modulescript to interface with the different abilities.

1 Like

i ve been searching on youtube any video that covers this topic’s subjet i ve ended up finding only a video about treeskill can u send me a video about abilities?

2 Likes

Here is an awesome playlist of abilities. I haven’t actually gone through these to review the design practices but if you’re just looking to make something cool then this should work!

However, because you want to make a ton of unique abilities, I really encourage you to learn about Object Oriented Programming with Lua. Having good script architecture will make your life so much easier because it will be a lot to manage lots of different abilities and scripts, and this is a good first step!

1 Like

but how can oop be useful here i mean water ability and fire ability how can oop make them easier
also one video of the playlist that u ve showed me … :neutral_face::neutral_face:

1 Like

Functional programming :muscle:

But seriously you don’t need oop for every situation. This is as simple as probably passing a player into a function and making them do something

3 Likes

You’re right, there are lots of avenues to designing something like this. I made the suggestion with scalability in mind but really it is not completely necessary!

Should you want to have each Ability contain more than a function (like a name, a description, etc.) then you may start storing Dictionaries that contain all of an ability’s data, which OOP might help with keeping orderly.

Of course, this is not my project and all speculative: OP is free to experiment to their heart’s content! Making an awesome game with a crazy amount of abilities is more important than doing it “neat”. XD

2 Likes

Oh my gosh, you’re right, this takes a whole lot of effort to try and read. XD

In that case, I suggest you look up on Youtube “Roblox script abilities”. It yields lots of different results. I do not have time to help look through them for you, but hopefully something comes up that will help walk you through learning to code one.

3 Likes

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