Reflection
Functions for accessing hidden properties, manipulating scriptable flags, and interacting with low-level Instance data that is normally inaccessible through standard Roblox APIs.
gethiddenproperty
Reads a non-scriptable (hidden) property from an Instance.
gethiddenproperty(instance: Instance, property: string) -> any| Parameter | Type | Description |
|---|---|---|
instance | Instance | The Instance to read from |
property | string | The property name |
Example
local workspace = game:GetService("Workspace")
local value = gethiddenproperty(workspace, "StreamingMinRadius")
print(value)sethiddenproperty
Sets a non-scriptable (hidden) property on an Instance.
sethiddenproperty(instance: Instance, property: string, value: any) -> void| Parameter | Type | Description |
|---|---|---|
instance | Instance | The Instance to modify |
property | string | The property name |
value | any | The value to set |
Example
sethiddenproperty(workspace, "StreamingMinRadius", 256)getproperties
Returns a dictionary of all property values on an Instance, including non-scriptable properties.
getproperties(instance: Instance) -> table| Parameter | Type | Description |
|---|---|---|
instance | Instance | The Instance to read properties from |
Example
local props = getproperties(workspace)
for name, value in pairs(props) do
print(name, "=", value)
endsetscriptable
Sets whether a property is scriptable (accessible from Lua) on an Instance.
Aliases: setpropertyable
setscriptable(instance: Instance, property: string, scriptable: boolean) -> void| Parameter | Type | Description |
|---|---|---|
instance | Instance | The Instance to modify |
property | string | The property name |
scriptable | boolean | true to make scriptable, false to make non-scriptable |
Example
-- Make a hidden property accessible normally
setscriptable(workspace, "StreamingMinRadius", true)
print(workspace.StreamingMinRadius) -- Now accessible!isscriptable
Returns true if the given property is scriptable on the Instance.
isscriptable(instance: Instance, property: string) -> booleanExample
print(isscriptable(workspace, "Name")) --> true
print(isscriptable(workspace, "StreamingMinRadius")) --> false (hidden)geteventmember
Creates an unrestricted signal for the specified event on an Instance. Useful for accessing events that are normally restricted.
geteventmember(instance: Instance, event_name: string) -> RBXScriptSignal| Parameter | Type | Description |
|---|---|---|
instance | Instance | The Instance containing the event |
event_name | string | The name of the event |
Example
local signal = geteventmember(game, "Loaded")
signal:Connect(function()
print("Game loaded!")
end)getnamecallmethod
Returns the current namecall method string. Typically used inside __namecall hooks to determine which method was called.
getnamecallmethod() -> stringExample
local mt = getrawmetatable(game)
local old_namecall = mt.__namecall
setreadonly(mt, false)
mt.__namecall = newcclosure(function(self, ...)
local method = getnamecallmethod()
if method == "Kick" then
return -- Block kick
end
return old_namecall(self, ...)
end)
setreadonly(mt, true)setnamecallmethod
Sets the namecall method for the current thread. Changes what getnamecallmethod() returns.
setnamecallmethod(method: string) -> void| Parameter | Type | Description |
|---|---|---|
method | string | The namecall method name to set |
Example
-- Inside a __namecall hook
setnamecallmethod("FindFirstChild")isrenderobj
Returns true if the given object is a Drawing render object.
isrenderobj(object: any) -> booleanExample
local circle = Drawing.new("Circle")
print(isrenderobj(circle)) --> true
print(isrenderobj(workspace)) --> false
circle:Remove()getcallbackvalue
Returns the callback function assigned to a callback property of an Instance.
getcallbackvalue(instance: Instance, property: string) -> function?| Parameter | Type | Description |
|---|---|---|
instance | Instance | The Instance to read from |
property | string | The callback property name |
Example
local remote = Instance.new("BindableFunction")
remote.OnInvoke = function()
return "hello"
end
local callback = getcallbackvalue(remote, "OnInvoke")
print(callback()) --> "hello"