setnamecallmethod
Sets the current namecall method for the active metamethod call.
Syntax
setnamecallmethod(method: string) -> nil
Parameters
| Parameter | Type | Description |
|---|---|---|
method | string | The method value used by the call. |
Returns
| Type | Description |
|---|---|
nil | This function does not return a value. |
Description
setnamecallmethod is part of the Metatables library. Metatable helpers operate below normal Lua protection: they read raw metatables, replace metamethods and inspect namecalls.
The change is applied directly to the live target, so later reads observe the updated value.
Example
hookmetamethod(game, "__namecall", function(self, ...)
setnamecallmethod("Custom")
return self
end)
Notes
- Metatable changes are applied directly to the live object.