How would I run a function via the command bar in the roblox studio? i.e. if want to make a global weld function I can run both in game and in the studio, what's the best way to go about it? Could I use a module script to do this? How would I call it in studio if I used a module script? Require doesn't seem to work in studio for me.
COMMUNITY QUESTION
Running global functions in the studio?
1 answer
You can use the _G or shared Tables. They are shared to all Scripts.
For instance:
_G.Weld = function()
--code
end
And in the command bar:
_G.Weld()
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Yeah, but I want easy access to the function so I can manipulate it easier. It'd be better if I could put it in a module script or somewhere tangible.
Additionally, I couldn't upload the code as a model to easily import it to other places.
You can set a Global function from literally any script or ModuleScript. At least test this first.
Yeah I know that, I've done this before. It's just not tangible. If I were to use a script to manipulate it, it would have to be in game. What I'm trying to say is I couldn't edit the function in studio without completely redefining the variable.