Ad
Log in to vote
0

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

Asked by
TechModel 118
5 months ago
Edited 5 months ago

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

Log in to vote
1
Answered by 5 months ago

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

Ad

Answer this question