Instances
Find hidden instances, fire interactions and reach non-scriptable properties.
Roblox's API only shows you part of the game. These functions find instances outside the tree, reach properties scripts normally can't, and trigger interactions directly.
References
cloneref
since 1.3.0cloneref(instance: Instance): InstanceReturns a new reference to instance. It reads and writes the same object, but it's a distinct value: it isn't == to the original and has its own identity as a table key.
Parameters
instanceInstance- The instance to reference.
Returns
InstanceA new reference to the same instance.
Example
gethui
since 1.2.0gethui(): InstanceReturns a container for your own interfaces, separate from PlayerGui and CoreGui. ScreenGuis parented here render normally and survive respawns.
Returns
InstanceThe container.
Example
Finding instances
getinstances
since 1.0.0getinstances(): {Instance}Returns every Instance the client knows about, including ones that aren't parented to the game tree.
Returns
{Instance}Every instance.
Example
getnilinstances
since 1.0.0getnilinstances(): {Instance}Returns every Instance whose Parent is nil. Games sometimes keep modules or remotes here, out of the tree.
Returns
{Instance}Unparented instances.
Example
Signals
getconnections
since 1.0.0getconnections(signal: RBXScriptSignal): {Connection}Returns every connection to signal, including connections made by game scripts. Each is a Connection object you can inspect, fire, disable or disconnect.
Parameters
signalRBXScriptSignal- Any event, such as
Part.Touched.
Returns
{Connection}The signal's connections. See the table below.
Example
Connection
EnabledbooleanEnable and Disable.ForeignStatebooleantrue when the connection was made by C code rather than Luau.LuaConnectionbooleantrue when the connection was made from Luau.Functionfunction?nil for foreign connections.Threadthread?Fire(...)Defer(...)Fire, but on the next resumption cycle.Disable()Enable is called.Enable()Disconnect()Interactions
fireclickdetector
since 1.0.0fireclickdetector(detector: ClickDetector, distance: number?, event: string?): ()Fires a ClickDetector as if the local player clicked it.
Parameters
detectorClickDetector- The detector to fire.
distancenumber?- Optional.The distance to report. Default
0. eventstring?- Optional.Which signal to fire:
"MouseClick","RightMouseClick","MouseHoverEnter"or"MouseHoverLeave". Default"MouseClick".
Example
firetouchinterest
since 1.0.0firetouchinterest(part: BasePart, other: BasePart, toggle: number): ()Simulates a touch between two parts, firing Touched and TouchEnded as if they had physically met.
Parameters
partBasePart- The part doing the touching, usually part of your character.
otherBasePart- The part being touched.
togglenumber0begins the touch,1ends it.
Example
fireproximityprompt
since 1.4.0fireproximityprompt(prompt: ProximityPrompt): ()Triggers prompt as if the local player completed it, without waiting for HoldDuration. Triggered and TriggerEnded fire as normal.
Parameters
promptProximityPrompt- The prompt to trigger.
Example
Hidden properties
gethiddenproperty
since 1.1.0gethiddenproperty(instance: Instance, property: string): (any, boolean)Reads any property, including ones that aren't scriptable. Returns the value and whether the property is hidden from normal scripts.
Parameters
instanceInstance- The instance to read from.
propertystring- The property name, as it appears in the Roblox API dump.
Returns
(any, boolean)The value, and true if the property is hidden.
Example
sethiddenproperty
since 1.1.0sethiddenproperty(instance: Instance, property: string, value: any): booleanWrites any property, including ones that aren't scriptable. Returns whether the property is hidden.
Parameters
instanceInstance- The instance to write to.
propertystring- The property name.
valueany- The new value. Must match the property's type.
Returns
booleantrue if the property is hidden.
Example
Written for Lynx 0.0.0
Something unclear? Tell us on Discord