VINDICTA.TOP
Debug · Library
Bunni.fun
ChocoSploit
Cryptic
Potassium
Seliware
SirHurt
Solara
Velocity
Volcano
Volt
Wave
Xeno

debug.setupvalue

Replaces an upvalue in a function.

function debug.setupvalue(funcfuncfunction | numberA Luau function or stack level.: function | number, indexindexnumberUpvalue index to replace.: number, valuevalueanyNew value.: any): ()

Usage

Replace an upvalue
local function somethingImportant() print("Goodbye, world!") end
local function foo() somethingImportant() end
debug.setupvalue(foo, 1, function() print("Hello, world!") end)
foo() --> Hello, world!