The Roblox wiki doesnt provide enough detail on pcall
I know it has to do something with solving errors but that's all I know.
Can anyone explain how it works and how and when to use it?
In basics a pcall or protected call is a way of managing errors when scripting in Lua, and it works by catching any errors in the function inside it. The advantage of using a pcall is if an error is found in the script then the whole script will not be terminated, just the function that has an error.
For some extra info it is also a boolean which returns true if there are no errors and false if one pops up.
Here is the the Lua book to explain more about it and how it can be used:
https://www.lua.org/pil/8.4.html
There has also been a similar question asked on Scripting Helpers before with a great answer from ScriptGuider:
https://scriptinghelpers.org/questions/39638/how-does-pcall-xpcall-and-ypcall-actually-work