ScriptContext
This class is not replicated. Its interface does not cross the network boundary.
This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is a service. It is a singleton that may be acquired with GetService.
Memory category | Instances |
---|
Member index 16
Removed member index 17
History | Member | |
---|---|---|
214 | GarbageCollectionFrequency: int | |
214 | GarbageCollectionLimit: int | |
272 | AddCoreScript(assetId: int, parent: Instance, name: string): void | |
273 | AddStarterScript(assetId: int): void | |
310 | GetHeapStats(clearHighwaterMark: bool = true): Tuple | |
310 | GetScriptStats(): Array | |
168 | LibraryRegistrationComplete(): void | |
168 | RegisterDevelopmentLibrary(libraryName: string, scriptInstance: Instance): void | |
168 | RegisterLibrary(libraryName: string, assetId: string): void | |
168 | RegisterRobloxLibrary(libraryName: string, assetId: string): void | |
401 | ResetCoverageCollection(): void | |
310 | SetCollectScriptStats(enable: bool = false): void | |
400 | SetCoverageFilter(callback: Function): void | |
401 | StartCoverageCollection(): void | |
401 | StopCoverageCollection(): void | |
310 | CamelCaseViolation(object: Instance, member: string, script: Instance) | |
76 | NonScriptableAccess(property: string, script: Instance) |
Description
This service controls all BaseScript objects. Most of the properties and methods of this service are locked for internal use.
History 93
- 648 Add CompressLuaApp
- 638 Add ReportLuaRequireCount
- 613 Change Parameters of DeserializeScriptProfilerString from (jsonString: string) to (jsonString: string?)
- 608 Change ReturnType of SaveScriptProfilingData from null to string
- 608 Change Parameters of SaveScriptProfilingData from (filename: string) to (jsonString: string, filename: string)
- 607 Add GetLuauHeapMemoryReport
- 607 Add GetLuauHeapInstanceReferenceReport
- 600 Add GetScriptProfilingData
- 587 Change Default of from true to false
- 573 Change ReturnType of StartScriptProfiling from void to null
- 573 Change ReturnType of SetTimeout from void to null
- 573 Change ReturnType of SaveScriptProfilingData from void to null
- 573 Change ReturnType of ClearScriptProfilingData from void to null
- 573 Change ReturnType of AddCoreScriptLocal from void to null
- 562 Change Tags of StopScriptProfiling from [CustomLuaState] to []
- 562 Change ReturnType of StopScriptProfiling from Dictionary to string
- 562 Change Parameters of StartScriptProfiling from () to (frequency: int?)
- 553 Change Default of from to true
- 547 Change ReturnType of StopScriptProfiling from string to Dictionary
- 547 Add SaveScriptProfilingData
- 547 Add DeserializeScriptProfilerString
- 538 Add StopScriptProfiling
- 538 Add StartScriptProfiling
- 538 Add ClearScriptProfilingData
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 468 Change Tags of from [NotReplicated] to [Hidden]
- 468 Change CanLoad of from true to false
- 462 Change ThreadSafety of ErrorDetailed from to Unsafe
- 462 Change ThreadSafety of Error from to Unsafe
- 462 Change ThreadSafety of SetTimeout from to Unsafe
- 462 Change ThreadSafety of GetCoverageStats from to Unsafe
- 462 Change ThreadSafety of AddCoreScriptLocal from to Unsafe
- 462 Change ThreadSafety of from to ReadOnly
- 442 Change Parameters of ErrorDetailed from (message: string, stackTrace: string, script: Instance, details: string) to (message: string, stackTrace: string, script: Instance, details: string, securityLevel: int)
- 417 Add ErrorDetailed
- 401 Remove StopCoverageCollection
- 401 Remove StartCoverageCollection
- 401 Remove ResetCoverageCollection
- 400 Remove SetCoverageFilter
- 356 Add StopCoverageCollection
- 356 Add StartCoverageCollection
- 356 Add SetCoverageFilter
- 356 Add ResetCoverageCollection
- 356 Add GetCoverageStats
- 310 Remove CamelCaseViolation
- 310 Remove SetCollectScriptStats
- 310 Remove GetScriptStats
- 310 Remove GetHeapStats
- 273 Remove AddStarterScript
- 272 Add AddStarterScript
- 273 Remove AddStarterScript
- 272 Remove AddCoreScript
- 214 Remove GarbageCollectionLimit
- 214 Remove GarbageCollectionFrequency
- 168 Remove RegisterRobloxLibrary
- 168 Remove RegisterLibrary
- 168 Remove RegisterDevelopmentLibrary
- 168 Remove LibraryRegistrationComplete
- 166 Add AddCoreScriptLocal
- 151 Change Security of SetTimeout from LocalUserSecurity to PluginSecurity
- 135 Change Security of Error from RobloxPlaceSecurity to None
- 76 Remove NonScriptableAccess
- 53 Change WriteSecurity of from None to LocalUserSecurity
- 53 Change ReadSecurity of from None to LocalUserSecurity
- 52 Change Security of RegisterRobloxLibrary from LocalUserSecurity to RobloxScriptSecurity
- 52 Change Security of RegisterLibrary from LocalUserSecurity to RobloxScriptSecurity
- 52 Change Security of RegisterDevelopmentLibrary from LocalUserSecurity to RobloxScriptSecurity
- 52 Change Security of LibraryRegistrationComplete from LocalUserSecurity to RobloxScriptSecurity
- 50 Change Security of SetCollectScriptStats from LocalUserSecurity to RobloxScriptSecurity
- 50 Change Security of GetScriptStats from LocalUserSecurity to RobloxScriptSecurity
- 50 Change ReturnType of GetScriptStats from Tuple to Array
- 50 Change Security of GetHeapStats from LocalUserSecurity to RobloxScriptSecurity
- 50 Change WriteSecurity of GarbageCollectionLimit from LocalUserSecurity to RobloxScriptSecurity
- 50 Change ReadSecurity of GarbageCollectionLimit from LocalUserSecurity to RobloxScriptSecurity
- 50 Change WriteSecurity of GarbageCollectionFrequency from LocalUserSecurity to RobloxScriptSecurity
- 50 Change ReadSecurity of GarbageCollectionFrequency from LocalUserSecurity to RobloxScriptSecurity
- 47 Add NonScriptableAccess
- 47 Add Error
- 47 Add CamelCaseViolation
- 47 Add SetTimeout
- 47 Add SetCollectScriptStats
- 47 Add RegisterRobloxLibrary
- 47 Add RegisterLibrary
- 47 Add RegisterDevelopmentLibrary
- 47 Add LibraryRegistrationComplete
- 47 Add GetScriptStats
- 47 Add GetHeapStats
- 47 Add AddStarterScript
- 47 Add AddCoreScript
- 47 Add
- 47 Add GarbageCollectionLimit
- 47 Add GarbageCollectionFrequency
- 47 Add ScriptContext
Members 16
AddCoreScriptLocal
Parameters (2) | ||
---|---|---|
name | string | |
parent | Instance | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 573 Change ReturnType of AddCoreScriptLocal from void to null
- 462 Change ThreadSafety of AddCoreScriptLocal from to Unsafe
- 166 Add AddCoreScriptLocal
ClearScriptProfilingData
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 573 Change ReturnType of ClearScriptProfilingData from void to null
- 538 Add ClearScriptProfilingData
CompressLuaApp
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 648 Add CompressLuaApp
DeserializeScriptProfilerString
Parameters (1) | ||
---|---|---|
jsonString | string? | |
Returns (1) | ||
Dictionary |
This function has a custom internal state. It may behave in a non-standard way.
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 613 Change Parameters of DeserializeScriptProfilerString from (jsonString: string) to (jsonString: string?)
- 547 Add DeserializeScriptProfilerString
Error
Parameters (3) | |
---|---|
stackTrace | string |
script | Instance |
Fired when an error occurs.
Thread safety | Unsafe |
---|
ErrorDetailed
Parameters (5) | |
---|---|
stackTrace | string |
script | Instance |
details | string |
securityLevel | int |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 462 Change ThreadSafety of ErrorDetailed from to Unsafe
- 442 Change Parameters of ErrorDetailed from (message: string, stackTrace: string, script: Instance, details: string) to (message: string, stackTrace: string, script: Instance, details: string, securityLevel: int)
- 417 Add ErrorDetailed
GetCoverageStats
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of GetCoverageStats from to Unsafe
- 356 Add GetCoverageStats
GetLuauHeapInstanceReferenceReport
Parameters (1) | ||
---|---|---|
target | string | |
Returns (1) | ||
Dictionary |
This function has a custom internal state. It may behave in a non-standard way.
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
GetLuauHeapMemoryReport
Parameters (1) | ||
---|---|---|
target | string | |
Returns (1) | ||
Dictionary |
This function has a custom internal state. It may behave in a non-standard way.
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
GetScriptProfilingData
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
string |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
ReportLuaRequireCount
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
SaveScriptProfilingData
Parameters (2) | ||
---|---|---|
jsonString | string | |
filename | string | |
Returns (1) | ||
string |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 608 Change ReturnType of SaveScriptProfilingData from null to string
- 608 Change Parameters of SaveScriptProfilingData from (filename: string) to (jsonString: string, filename: string)
- 573 Change ReturnType of SaveScriptProfilingData from void to null
- 547 Add SaveScriptProfilingData
SetTimeout
Parameters (1) | ||
---|---|---|
seconds | double | |
Returns (1) | ||
null |
Limits how long a script is allowed to run without yielding.
Security | PluginSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 573 Change ReturnType of SetTimeout from void to null
- 462 Change ThreadSafety of SetTimeout from to Unsafe
- 151 Change Security of SetTimeout from LocalUserSecurity to PluginSecurity
- 47 Add SetTimeout
StartScriptProfiling
Parameters (1) | ||
---|---|---|
frequency | int? | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 573 Change ReturnType of StartScriptProfiling from void to null
- 562 Change Parameters of StartScriptProfiling from () to (frequency: int?)
- 538 Add StartScriptProfiling
StopScriptProfiling
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
string |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 562 Change Tags of StopScriptProfiling from [CustomLuaState] to []
- 562 Change ReturnType of StopScriptProfiling from Dictionary to string
- 547 Change ReturnType of StopScriptProfiling from string to Dictionary
- 538 Add StopScriptProfiling
Removed members 17
AddCoreScript
Parameters (3) | ||
---|---|---|
assetId | int | |
parent | Instance | |
name | string | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 272 Remove AddCoreScript
- 47 Add AddCoreScript
AddStarterScript
Parameters (1) | ||
---|---|---|
assetId | int | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 4
- 273 Remove AddStarterScript
- 272 Add AddStarterScript
- 273 Remove AddStarterScript
- 47 Add AddStarterScript
CamelCaseViolation
Parameters (3) | |
---|---|
object | Instance |
member | string |
script | Instance |
Security | RobloxScriptSecurity |
---|
History 2
- 310 Remove CamelCaseViolation
- 47 Add CamelCaseViolation
GarbageCollectionFrequency
Type | Default | |
---|---|---|
int |
Security | RobloxScriptSecurity |
---|---|
Category | |
Loaded/Saved | false |
History 4
- 214 Remove GarbageCollectionFrequency
- 50 Change WriteSecurity of GarbageCollectionFrequency from LocalUserSecurity to RobloxScriptSecurity
- 50 Change ReadSecurity of GarbageCollectionFrequency from LocalUserSecurity to RobloxScriptSecurity
- 47 Add GarbageCollectionFrequency
GarbageCollectionLimit
Type | Default | |
---|---|---|
int |
Security | RobloxScriptSecurity |
---|---|
Category | |
Loaded/Saved | false |
History 4
- 214 Remove GarbageCollectionLimit
- 50 Change WriteSecurity of GarbageCollectionLimit from LocalUserSecurity to RobloxScriptSecurity
- 50 Change ReadSecurity of GarbageCollectionLimit from LocalUserSecurity to RobloxScriptSecurity
- 47 Add GarbageCollectionLimit
GetHeapStats
Parameters (1) | Default | |
---|---|---|
clearHighwaterMark | bool | true |
Returns (1) | ||
Tuple |
Security | RobloxScriptSecurity |
---|
History 3
- 310 Remove GetHeapStats
- 50 Change Security of GetHeapStats from LocalUserSecurity to RobloxScriptSecurity
- 47 Add GetHeapStats
GetScriptStats
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
Security | RobloxScriptSecurity |
---|
History 4
- 310 Remove GetScriptStats
- 50 Change Security of GetScriptStats from LocalUserSecurity to RobloxScriptSecurity
- 50 Change ReturnType of GetScriptStats from Tuple to Array
- 47 Add GetScriptStats
LibraryRegistrationComplete
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 3
- 168 Remove LibraryRegistrationComplete
- 52 Change Security of LibraryRegistrationComplete from LocalUserSecurity to RobloxScriptSecurity
- 47 Add LibraryRegistrationComplete
NonScriptableAccess
Parameters (2) | |
---|---|
property | string |
script | Instance |
Security | RobloxScriptSecurity |
---|
History 2
- 76 Remove NonScriptableAccess
- 47 Add NonScriptableAccess
RegisterDevelopmentLibrary
Parameters (2) | ||
---|---|---|
libraryName | string | |
scriptInstance | Instance | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 3
- 168 Remove RegisterDevelopmentLibrary
- 52 Change Security of RegisterDevelopmentLibrary from LocalUserSecurity to RobloxScriptSecurity
- 47 Add RegisterDevelopmentLibrary
RegisterLibrary
Parameters (2) | ||
---|---|---|
libraryName | string | |
assetId | string | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 3
- 168 Remove RegisterLibrary
- 52 Change Security of RegisterLibrary from LocalUserSecurity to RobloxScriptSecurity
- 47 Add RegisterLibrary
RegisterRobloxLibrary
Parameters (2) | ||
---|---|---|
libraryName | string | |
assetId | string | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 3
- 168 Remove RegisterRobloxLibrary
- 52 Change Security of RegisterRobloxLibrary from LocalUserSecurity to RobloxScriptSecurity
- 47 Add RegisterRobloxLibrary
ResetCoverageCollection
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 401 Remove ResetCoverageCollection
- 356 Add ResetCoverageCollection
SetCollectScriptStats
Parameters (1) | Default | |
---|---|---|
enable | bool | false |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 3
- 310 Remove SetCollectScriptStats
- 50 Change Security of SetCollectScriptStats from LocalUserSecurity to RobloxScriptSecurity
- 47 Add SetCollectScriptStats
SetCoverageFilter
Parameters (1) | ||
---|---|---|
callback | Function | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 400 Remove SetCoverageFilter
- 356 Add SetCoverageFilter
StartCoverageCollection
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 401 Remove StartCoverageCollection
- 356 Add StartCoverageCollection
StopCoverageCollection
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 401 Remove StopCoverageCollection
- 356 Add StopCoverageCollection