Ok so, I want to make something that stores a specific weapon, like a Sword, and has different skill for that specific weapon. I heard that module scripts were a good way to do this all. In general I want a weapon ability system similar to blox fruits.
local Earth = require(script.Earth)
Earth["Rock Grasp"]()
This will run the code in your ModuleScript and print “First ability” in the Output window.
This data structure is good to work with if order doesn’t matter. You can refer to the function by using the name in your code.
→ This means: if you want to enforce a specific order or based on keybind, you should use that as index instead of the name. Can elaborate if needed.
question, should I reference the module script in a local script? I’m assuming that I’m supposed to grab values from the module script inside the local script and then fire a remote event to the server
You can reference stuff such as names in local scripts, if you want to display the ability names to the player as an example, but activate the abilities on the server, by yes, use of a remote event.