Skip to content
Saiko

getcallingscript

Returns the script responsible for the current call, or nil when the executor itself is calling.

Signature

luau
getcallingscript(): BaseScript?

Returns

BaseScript?

Example

luau
local hook
hook = hookmetamethod(game, "__namecall", function(self, ...)
    if getnamecallmethod() == "FireServer" and not checkcaller() then
        print("fired by", getcallingscript())
    end
    return hook(self, ...)
end)