Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How could I use module scripts for tools such as guns?

Asked by 5 years ago

I've been using module scripts for Server Scripts to Module Script communication, but I've ever used Module Scripts for local scripts. I've been finding it super frustrating to trial and error my local script inside a tool to achieve an event using the various functions such as Tool.Activated etc. But can I use what happens inside these local scripts and convert them into a module script, and if possible how could I achieve this?

0
It really depends. If is a huge task then yes you should use module for organisation. User#24403 69 — 5y
0
like what incap said, if your tool is complex and has many tasks you could segregate them into different functions in a modulescript GoldAngelInDisguise 297 — 5y
0
I forgot to elaborate on the frustrating part, it's because I would have to keep replacing all the scripts in all the tools if i were to change something. Marmalados 193 — 5y

1 answer

Log in to vote
0
Answered by
Lualaxy 78
5 years ago

Module Scripts are made to start when they have what they require such as a function being run or anything similar (Or just return a value). With guns, you can make a function triggering reload when the ammo is 0 or something like that since it is required to have 0 ammo to trigger it.

If anyone would like to correct me or add something onto this comment feel free to do so.

Ad

Answer this question