Reflection
Read and write hidden properties, raise or query thread identity, toggle scriptability, and check network ownership at runtime.
Roblox hides a lot of its own state from scripts: properties marked non-scriptable, values only the engine reads, ownership flags. Reflection is the way past that, and thread identity is the lever it pulls.
Identity is a number describing how much the running thread is trusted. Your scripts run at 8. A normal game script runs at 2. Some engine internals only answer to higher levels, and some game checks expect to see a lower one.
-- Read a property Roblox does not expose to scripts.
local part = workspace:FindFirstChildWhichIsA("BasePart")
print(gethiddenproperty(part, "NetworkOwnershipRule"))
-- Make it scriptable, change it normally, then put it back.
local wasScriptable = isscriptable(part, "NetworkOwnershipRule")
setscriptable(part, "NetworkOwnershipRule", true)
part.NetworkOwnershipRule = Enum.NetworkOwnership.Manual
setscriptable(part, "NetworkOwnershipRule", wasScriptable)
-- Who owns the physics for this part right now?
print(isnetworkowner(part))Put identity back
If you lower your identity for a call, raise it again afterwards — ideally in a pcall cleanup. A script stranded at identity 2 loses access to most of this API and the failure looks like the function is broken.