ScriptObject:HasScript
Jump to navigation
Jump to search
Returns true if the region supports the given script type.
hasScript = ScriptObject:HasScript(scriptName)
Arguments
- scriptName
- string - Name of the script type, for example "OnShow".
Returns
- hasScript
- boolean
Example
The OnShow script type is supported by Frame, OnClick is not.
local f = CreateFrame("Frame")
print(f:HasScript("OnShow")) -- true
print(f:HasScript("OnClick")) -- false