Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
TechModel 118
2 years ago
Edited 2 years 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?

01local s, e = pcall(function()
02    -- codes
03    function Omg(Player)
04        local s, e = pcall(function()
05            -- codes
06        end)
07        if not s then
08            print(e) -- this confuse me
09        end
10    end
11    Omg()
12    if not s then
13        print(e) -- does this "e" pick up inside function e?
14    end
15 
View all 25 lines...

1 answer

Log in to vote
1
Answered by
Puppynniko 1059 Moderation Voter
2 years 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