Scripts
Scripts can be formatted in a few different ways to change their representation in Roblox.
Script Directives
Add Directives to the top of your script to change its ClassName, control its RunContext, or disable it.
Script Directives
Directive | ClassName | RunContext | Behavior |
---|---|---|---|
None | ModuleScript | - | None |
--@script --@script:legacy | Script | Legacy | Runs in legacy script containers dependent on the type of script. |
--@script:server | Script | Server | Runs on the server. |
--@script:client | Script | Client | Runs on the client. |
--@localscript --@script:localscript | LocalScript | - | Runs in legacy script containers dependent on the type of script. |
--@disabled | - | - | Determines whether the script will run or not. |
Init Scripts
Any file ending in Init.LUA
or {parent directory's name}.Init.LUA
will change its parent directory to a script with the contents of the file.
Like all directories, contents inside the parent directory will be parented to the script.