I’m trying to get succes to both false and true by just remove the ) after each attempt
However, the script still errors and pcall doesn’t do anything… Am I missing something?
I’m trying to get succes to both false and true by just remove the ) after each attempt
However, the script still errors and pcall doesn’t do anything… Am I missing something?
Pcall catches an error inside a function, the error you are encountering is a syntax error outside the function. Remove the ) after end. Pcall won’t work for syntax errors as the script will automatically error and terminate itself whenever there is one.
You should remove ) in end
.
Also, pcall is a function that acts like a normal script except if there is an error, it won’t stop your script from running. It’s basically like a seperate script in the same script. If that function in the pcall gets an error, that function will stop. Just not the entire script.
I expected pcall to handle the syntax error for me but I guess not
The pcall
function only catches errors that occur within the provided callback function.
Errors will only be detected within the code inside the blue squares.
Syntax error is a COMPILATION error which happens before the pcall is even called, the code won’t be executed until the compilation is done.
Pcall is used to handle errors within the code and not the syntax errors.
Pcalls can be used for
etc…
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.