This is part two of the
Going over Lua-Beginning-Lab Challenges Project Guide.
Level one was really fun, and if you didn't see it, here is the link. I recommend trying some of the challenges yourself if you're attempting to learn Lua, or better yourself.
Let's jump right in with it!
I do see a lot of people no fully understanding what a
debounce is. It's basically just a variable that can stop code from running at certain times, or only allow code to run when needed. Because there are two buttons I could have done this multiple ways, but I just decided to go simple.
It is worth noting that I didn't check to make sure that a player is the one who touched the part. It didn't ask for it, and I'm lazy.
They give you a hint to use
BodyMovers, but I went with just using
Because I'm working with
R15, I decided to make all my scripts compatible for both.
This one seems simple enough. Here is my solution:
That was fun. Never realized how simple making a Tool Giver could be.
Fun! Theirs didn't blow up, so these must be toy rockets. I won't be using an
BodyMovers, just because I feel it would add more code. I tried making my solution simple. Here's what I came up with:
Again, just basic bare-bones. It spawns a part and shoots it into the air.
They're getting harder. But this one is actually very fun, and I think you should try this one for yourself. See if you can do better than me. Here was my solution:
Lucky number 13.
Nice typo. I was hoping for no client side projects, but okay. This one only gives you 3 lines, which is interesting. I don't think it wants you too hook it up to a touched event, so I didn't.
This doesn't actually work, but I'm pretty sure it used to. This only works if you don't spawn with a character. I think this is what they were looking for, though. Now the player tries making the camera type Custom again, so you have to account for that. I didn't however. Call me lazy.
This is at least doable rather easy. Here is my solution:
I again didn't use
BodyMovers because I don't want to... okay!
That's the end of Level Two! I'm excited to do Level Three! Thanks for reading, and I hope I inspire you to take on more challenges!
Here's a link to the place with all my examples for you too look more closely at.
If you're hungry for more, you can read the final part of this tutorial here.