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

How to determine which picks up multiple variables but are the same?

As in meaning two variables with the same name like putting pcalls in every function to ensure smooth and error less. However I can't just generate myself random locals for every pcalls I made. Is this really picking up errors with correct variables or out of the function variables printing inside it?

And making the fucntion not local, it picks it up?

local s, e = pcall(function()
	-- codes
	function Omg(Player)
        local s, e = pcall(function()
            -- codes
        end)
        if not s then
            print(e) -- this confuse me
        end
    end
	Omg()
	if not s then
		print(e) -- does this "e" pick up inside function e?
	end

	local s, e = pcall(function()
	-- codes
	if not s then
		print(e) -- does this "e" pick up inside function e?
	end

end
if not s then
	print(e) -- does this "e" pick up inside function e?
end

1 answer

✓ Accepted answer

so roblox Luau goes from top to bottom and when the variables get changed at the top it gets overridden by the bottom lines of code

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