LuaSourceContainer
The base of every object that holds code: each ShotScript or plain Luau file in your project is one.
You never make one: Instance.new refuses every script class, since a script comes from the project's tree. Add it in the editor and reach it through script or root. IsA("LuaSourceContainer") is true for every script, and Clone copies a script's source with it.
A base class: you work with its subclasses.
Example
-- This program is a .shot file and Prices a plain Luau module (Prices.luau, returning a table): both are ModuleScripts.
use Prices
print("an Apple costs " .. Prices.Apple .. ", a Pear " .. Prices.Pear)
local files : {ModuleScript} = { script, root.Prices }
for _, file in files do
print(file.Name .. ": ModuleScript " .. tostring(file:IsA("ModuleScript")) .. ", LuaSourceContainer " .. tostring(file:IsA("LuaSourceContainer")))
end
print("the program's Parent is the project's root: " .. tostring(script.Parent == root))an Apple costs 3, a Pear 2 Main: ModuleScript true, LuaSourceContainer true Prices: ModuleScript true, LuaSourceContainer true the program's Parent is the project's root: true
From ShotInstance 33
ClassNameNameParentAncestryChangedAttributeChangedChangedChildAddedChildRemovedDestroyingAddTagClearAllChildrenCloneDestroyFindFirstAncestorFindFirstAncestorOfClassFindFirstAncestorWhichIsAFindFirstChildFindFirstChildOfClassFindFirstChildWhichIsAGetAttributeGetAttributeChangedSignalGetAttributesGetChildrenGetDescendantsGetFullNameGetPropertyChangedSignalGetTagsHasTagIsAIsAncestorOfIsDescendantOfRemoveTagSetAttribute
Subclasses
