Hey there, I’m newer to the Developer Forum, and I apologize if I’m not knowledgeable in the subject of scripting as much as some of you, but I do have a question; how would I make the output into a GUI?
I’m attempting to make a test game where you would be able to play community-made maps for my own game, however it needs to tell the player if there is an error somewhere within the code of the map script. Without this, the player may seem confused if their map doesn’t work, and may give up on creating/fixing the map.
I’ve been trying to figure out how to achieve this, but I still can’t seem to find a clear answer; any help would be greatly appreciated!
(If there isn’t a way, just let me know since I’ll try to figure something else myself, since this is a learning process for me. )
There may be a better solution, but you can use a bunch of pcalls. Wrap anything that can error in a pcall, and if it errors then tell the player what is wrong and how they might fix it.
This is a bad way to do this, pcall is meant to stop errors from propagating in a function where the function raises an error to signify something went wrong. (ex: datastore requests) pcall also messes with traceback, which adds to some more complexity when debugging.