Garry's Mod Wiki

debug.setupvalue

string debug.setupvalue( function func, number index, any val = nil )

Description

This function was removed due to security concerns.

Sets the variable indexed from func

Arguments

1 function func
The function to index the upvalue from
2 number index
The index from func
3 any val = nil
The value to set the upvalue to.

Returns

1 string
Returns nil if there is no upvalue with the given index, otherwise it returns the upvalue's name.

Example

An example demonstrating a function overwrite.

local function my_isfunction(f) return type(f) == "function" or f == "coolguy" end print(debug.setupvalue(hook.Add, 1, my_isfunction))

Page Links


Special Pages


Wikis

?

Render Time: 36ms

DB GetPage 3
Generate Html 10
SaveChanges (1) 9
Render Body 0
Render Sidebar 12