Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to get all the variables of a function?

I tried

function Load()
	CurrentBase = game.Workspace.Baseplate
	CurrentBase.BrickColor = BrickColor.Random()
end

for i, v in pairs(getfenv(Load)) do
	print(i,"=",v)
end

1 answer

You can just return the variables in the function

Example:

function Load()
	CurrentBase = workspace.Baseplate
	CurrentBase.BrickColor = Brickcolor.Random() 
	return CurrentBase, CurrentBase.BrickColor
end

print(Load())

This discussion is preserved as it was. New answers, comments, and votes are closed.