Hello!
Pcall functions basically catches if any errors happen in the function. The reason why they should be used inside of things when using data stores is because the API that datastores use can sometimes go down which can cause errors in your script causing the whole code to stop working as it should.
If you ever see this message in the docs (old ones) then you should use a pcall function:
In the new docs it looks like something like this:
What do you mean by “How does the Datastore Service Work?”. What part do you need to understand? In general you just get the datastore service and then get the data store from the service and then once you have the data store do things like getAsync and as such.
Inside of Lua a tuple is a list of variables. Often you will find them inside of things such as a method accepting multiple variables/arguments.
You can get a bit more info here: https://developer.roblox.com/en-us/articles/Tuple#:~:text=In%20Roblox%2C%20the%20tuple%20type,means%20it%20returns%20multiple%20values.
To be honest I am not really sure how to explain what they are but here is an image I found on google which shows it well (language in the image is not lua but you get the idea).
Invoking (or at least what I know it off) is normally where you are expecting something back. An example of invoking in a remote function where you invoke the server or client and it expects back a value.
Now I have to admit I was not 100% sure about what setfenv and getfenv does. After some quick research it seems to allow you to set a script global variables (also known as environmental/env variables). After doing some research I kinda understand a bit (I kinda get it from using .env in node.js for Discord bots and websites) but still don’t massively understand the use of it (even in the post I will link below which explains it very well said you are very unlikely to ever use it).
Basically allow you to get the datatype of a Roblox datatype.
I highly recommend checking this post. It explains xpcalls, pcalls and ypcalls very well.
All it does is gives you the current version of Lua. It’s really not at all important for game devs and see 0 uses of it tbh.




