iscorescript Synchronous
Check whether a script belongs to Roblox’s CoreGui, rather than to the game or a player. Use it to leave core scripts out of a script scan.
Luau
iscorescript(script: ScriptInstance) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
script | ScriptInstance | A LocalScript, Script, or ModuleScript. Any other value raises an error. |
Returns
booleantrue when the script is a descendant of CoreGui, otherwise false.
Usage notes
The check follows the script’s current ancestry, so a script moved out of CoreGui reports false.
Example
Luau
for _, scriptInstance in ipairs(getscripts()) do
if not iscorescript(scriptInstance) then
print(scriptInstance:GetFullName())
end
end