Sign in
Home
Online Classes
Instructors
Tutorials
☰
Register
Sign in
Online Classes
Instructors
Tutorials
1. Open Roblox studio and load the starter kit
2. Test the game out
3. Add a script to ServerScriptService
4. Create and start a "leaderboard" function
5. Finish filling out the variables
6. Run the leaderboard function when the player loads
7. (Concept Excercise) Find and read your lemon's script (c)
8. Program to see if a humanoid touched the lemon
9. Add +1 to your total lemons if you collect a lemon
10. Teleport the lemon somewhere else
11. Run the collect function when the lemon is touched
12. Test and duplicate lemons
13. Store the lemonade stands in the server
14. Add a script to your "BuyStand" button
15. Setup variables for the BuyStand script
16. Create and activate a "buystand" function
17. Program to see if a humanoid touched the button
18. Check to see if the player is allowed to buy the stand
19. Program subtracting money
20. Finish programming the lemonade stand purchase
21. Create a function for earning money
22. Check to see if the player is able to make lemonade
23. (Concept Exercise) How to make and sell lemonade (c)
24. Test and duplicate buystand buttons
25. (Optional) Program the deluxe lemonade stand
Project 387: Lemonade Tycoon
22. Check to see if the player is able to make lemonade
The player needs to have enough lemons in their inventory before they can start making lemonade! Otherwise that lemonade would be coming out of thin air.
Starting point file for this challenge
Hint: show steps
Steps
1. Create a forever loop
Hint: show details
A forever loop written in Lua is simply the line "while true do." Then, hit return to create an "end" to this forever loop.
Whatever's in between the "do" and the "end" will happen forever.
while true do end
Hint: show image
Hint: show code
2. Create an if-then statement that checks if the player has at least 1 lemon
Hint: show details
Check to see if lemons is greater than or equal to 1.
Remember to hit return on your keyboard to create an "end" to this if-statement.
if lemons.Value >= 1 then end
Hint: show image
Hint: show code
3. Access the lemon variable
Hint: show details
Just like the coins variable, the lemons variable is actually hiding in another script - the leaderstats script, in the player.
player.leaderstats.lemons.Value
Hint: show image
Hint: show code
×
×
Provide your email address for immediate project access
Email
Check your email for instructions on how to create a full DA account