Script
A ShotScript file in your project: a module, a class, or a program that runs top to bottom.
Script is the class of a .shot file in the project's tree, and it runs as a ModuleScript. A .shot that declares nothing is a program: name it in the header's export line and shot run runs it once, top to bottom. A module or a class needs a types line and a Types.shot beside it. Scripts aren't made with Instance.new: add them in the editor.
A script comes from the project's tree: add it in the editor and reach it through script or root.
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
