Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Would this be possible? [Lua Require]

So I'm scripting this thing in roblox which needs a few scripts to run so to make it easier and make it so people cant find the script in my game is it possible to do a require like this?

local Script1 = require("rbxassetid://IDHere");

If it cant be done please reply if its wrong and i'm doing it wrong, please reply with what I did wrong.

8 comments

1

'require(IDHere)' works, make sure it is not a string.

0

Oh thanks!

0

@TheDeadlyPanther should I be concerned if it says "Unable to find module for asset id"

0

Yes, what exactly did you upload it with? The ModuleScript needs to be named MainModule, and uploaded as a model.

0

@TheDeadlyPanther I uploaded it with the Roblox Selection and I named it something else than the "Script1"?

0

@TheDeadlyPanther when I test it in game it says this "require(assetid) cannot be called from a client"

0

Game players cant see any script. Have you played any roblox game?

1 answer

You can use Require for scripts. Instead of putting local Script1 = require("rbxassetid://IDHere"), you would put require(IDHere). The module script that you upload as the asset will need to be named 'MainModule'.

If this helped, please accept it.

-Best regards

This discussion is preserved as it was. New answers, comments, and votes are closed.