Hi @trueisawesome,
With due respect, you are asking too many questions in one post. I suggest that you approach one issue at a time, being very specific about what you want to achieve. Then, when that part is solved, move on to the next part. This is the best way to learn, and a much better approach to seeking assistance in the forums.
For example, you say that you want to detect “when a certain figure touches the ground”. That is issue #1. Do you want to use physics? If so, do you understand the physics engine? Do you understand how to implement collision detection? When you understand these points, and you have it working in your game, only then should you proceed to “how to make it trigger restart.lua”.
We are all here (staff and other developers) to help, but you’ll receive better help by asking more specific questions, learning about topics yourself, and then asking how to solve a specific topic.
Best regards,
Brent