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
You can use ModuleScript for each ability type (AOE, Single, etc.), this simply contains the VFX to play abilities locally per player.
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).
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.
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.
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?
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!
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
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.