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

Can you not access a module script from the studio command bar? (RE UPLOAD)

Asked by 4 years ago

Don't believe you can bump old posts so i'm just gonna re upload this cause I'm still not 100% sure. So basically I've started learning to use ModuleScripts but I like testing things as I go along to better my understanding when I learn to use them. I've been trying to print out values from a table I have in my module script but it doesn't seem to produce updated values based off my scripts unless I actually go into the game by pressing the green Play button and print it from the developer console, or I access it from a script that I've placed into the game before I start up the game. Is there a way to do this from the studio command bar? Could this just be an intentional feature? Just wanted to make sure I'm not doing anything wrong.

1 answer

Log in to vote
1
Answered by
royaltoe 5144 Moderation Voter Community Moderator
4 years ago

Taken of the module script page

Using require on a ModuleScript in a LocalScript will run the code on the client, even if a Script did so already on the server ( . . . ) using require on a ModuleScrip in the Command Bar will give a similar behavior.

TL;DR if you have the module somewhere the player can't access like server script storage, you can't acquire the module.

0
did this work? please mark it as accepted if it works. royaltoe 5144 — 4y
0
I already knew that a CLIENT couldn't access a ModuleScript on the server side but the page you linked suggests that the command bar is considered a separate environment. So essentially it means that when sending commands into the command bar it isn't being executed on the regular server or client environment. It does still help though as I know I'm not doing anything wrong. Thanks! Optimalpokemon123 37 — 4y
0
Yeah. I was trying to do the same earlier this week. When you're using the command line and you're playing as a player, studio will treat whatever you put in the console as if it was in a local script. When you switch to playing as the server, then the game treats anything you put in the console as a server script. The thing is, the wiki says that no matter if you're using the command bar on the s royaltoe 5144 — 4y
0
server or the client, they still can't be required through the command line. A bit annoying, but guess there's no real need to do that anyway unless you're doing something to automate tasks in studio using a buncha modules. royaltoe 5144 — 4y
0
right yeah, it's not a big deal I mostly wanted to use it for debugging. Optimalpokemon123 37 — 4y
Ad

Answer this question