VINDICTA
Closures · Function
Bunni.fun
ChocoSploit
Cryptic
Potassium
Seliware
SirHurt
Solara
Velocity
Volcano
Volt
Wave
Xeno

getcallingscript

Returns the Script instance that initiated the current call chain.

function getcallingscript(): Script?

Synopsis

How it works

Traverses the Luau call stackCall stackThe chain of CallInfo frames representing nested function calls. Each frame records the closure, base register, top, and saved program counter. Walking the call stack reveals the full execution trace. upward, inspecting each frame's associated script context. Returns the first Script / LocalScript / ModuleScript InstanceInstanceThe base class for all Roblox objects (Parts, Models, Scripts, GUIs, etc.). Instances form a tree hierarchy (the DataModel). In Luau, they appear as userdata with shared metatables. found in the caller chain. If the entire chain is executor-owned (no game script context), returns nil.

Use case

Inside hooked functions, use this to identify which game script triggered the call. Useful for targeted interception — e.g., only modifying behavior when called by a specific anti-cheatAnti-cheatGame-side Luau scripts designed to detect and prevent exploitation. Common checks: verifying closure types (iscclosure), checking metatable integrity, monitoring remote call patterns, and scanning for known executor globals. LocalScriptLocalScriptA Roblox script type that runs on the client (player's machine). Has access to client-only APIs like UserInputService, Camera, and local player. Executes in the context of the local Player..

Usage

Log caller identity
hookfunction(game.Players.LocalPlayer.Character.Humanoid.TakeDamage, newcclosure(function(self, amount)
	print("TakeDamage called by:", getcallingscript())
end))

Returns

Script? The script instance that initiated this call, or nil.