I never really used these call's or whatever they are called, little help will be very appreciated!
COMMUNITY QUESTION
What is difference between pcall and ypcall?
1 answer
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().
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I like this! though it would really help if you could please provide just one example :D. Thanks in advance.