Project 387: Lemonade Tycoon

10. Teleport the lemon somewhere else

After you collect the lemon, teleport it somewhere random so you have to find it to collect it again. (Why wouldn't we want to just destroy the lemon?)
Starting point file for this challenge

Steps

1. Grab the lemon's position

lemon.Position is where the lemon's position is being stored. 

lemon.Position

2. Create a new vector3 value and set all coordinates to 0 for now

A vector3 value is a way to hold x, y and z coordinates. For now, set all 3 spots to 0. 

This code will set the lemon to the middle of your baseplate. 

Vector3.new(0, 0, 0)

3. Randomize the x and z values

Use the math.random() function to make the lemon choose new x and z values between -100 and 100 

In other words, the lemon should teleport somewhere random now. 

lemon.Position = Vector3.new(math.random(-100,100),0,math.random(-100,100))

4. Set Y to 3

This will tell our lemon to teleport just above the ground. 

Vector3.new(math.random(-100,100),3,math.random(-100,100))