I never really used these call's or whatever they are called, little help will be very appreciated!
pcall() is like your try catch block for other languages, but it has problems when used when yielding coroutines (the wait() function does this).
In roblox, you will generally want to use ypcall(), as this allows yielding across coroutines (using the wait() function inside a coroutine). They are used by passing a function.
For example;
pcall(function () wait() end) -- will error ypcall(function () wait() end) -- will not error --They are used like this: if ypcall(doSomeDangerousFunction()) == true then someDangerousFunctionSucceeded() end
Click here for more information on pcall().
Marked as Duplicate by evaera
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?