128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 06 Jan 2015 07:08 PM |
I'm making an admin script and need it to be able to do local things to people
Should I make 1 local script with lots of functions in it or lots of local scripts for each thing it needs to do |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2015 07:12 PM |
| 1 Local script with lots of functions, unless you want to make groupings, then use ModuleScripts. Have a LocalScript to manage local commands, and ModuleScripts in it to sort the commands. This would also allow you to make add-on modules for it. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 06 Jan 2015 07:15 PM |
| Do you mean like make a module script with every local command in it, and then have a local script require it, and then make the local script wait for the server script to tell it what to do? |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 06 Jan 2015 07:25 PM |
Wait
Can local scripts use loadstring even if loadstring isn't enabled and server scripts cant
Or is it the other way around |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Jan 2015 07:26 PM |
| Local scripts can never use loadstring, the property is only meant for server scripts and whether or not they can :) |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2015 07:26 PM |
No, multiple ModuleScripts each with it's own set of commands.
So you can have a module related to fun commands, one for just the general administrative commands, and things like that. I had multiple more suggestions for modules, but I remembered that this is just the client.
So just have the LocalScript wait for a moment, then require all of it's children modules, adding the commands from a returned table into a table containing all of the commands.
Anyhow, I really like that idea, because then you can use add-on modules and such. That's just the way I would do it, but obviously up to you. |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2015 07:27 PM |
"And then wait for the server script to tell it what to do" Well, you can do that just by sending a RemoteEvent to execute the command on the client, or you can read chat on the client too.
You can use a loadstring-workaround with a parser :) |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 06 Jan 2015 07:28 PM |
| Where can I put the local script so it doesn't have to be regiven to the player every time they spawn |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 06 Jan 2015 07:33 PM |
| I want the script to not be removed though, because if it has to reload every time then it has to require all the modules again |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 06 Jan 2015 07:36 PM |
yeah, startertools
they dont reset upon death, not sure if local scripts run in it tho |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 06 Jan 2015 07:37 PM |
They don't run, and get cloned and ran in the backpack
So it would still run every time |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 06 Jan 2015 07:40 PM |
| Scripts don't run in the player |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Jan 2015 07:42 PM |
game.Players.ChildAdded:connect(function(p) --run stuff? end) --in a local script in workspace? |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 06 Jan 2015 07:43 PM |
| Local scripts don't run in workspace and that is not my problem |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Jan 2015 07:43 PM |
| Am I the only one who creates a whole API and set the environment for the "round/map/etc. script" of each? |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
| |
|