Yuari
Documentation
Docs/Script/iscorescript

iscorescript(instance)

Returns whether a script is a Roblox core script.

Syntax

iscorescript(instance: Instance) -> boolean

Parameters

ParameterTypeDescription
instanceInstanceScript, LocalScript or ModuleScript to check.

Returns

TypeDescription
booleantrue when the script is under CoreGui or CorePackages.

Description

Walks the script's Parent chain and reports true when a CoreGui or CorePackages ancestor is found. PlayerModule and other regular LocalScripts return false.

The same check is used internally by getscripts so core scripts are excluded from executor results.

Example

local module = game:GetService("Players").LocalPlayer.PlayerScripts:FindFirstChild("PlayerModule")
print(iscorescript(module)) -- false