debug.setupvalue

From Garry's Mod
Jump to: navigation, search
 debug.setupvalue( )

Contents

Description

This page has been nominated for deletion.
Reason for deletion: This function was removed due to security concerns.

Sets the variable indexed from func

Arguments

function func

The function to index the upvalue from

Arguments

number index

The index from func

Arguments

any val=nil

The value to set the upvalue to.

Returns

string

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

Examples

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))


Personal tools
Navigation