Project 536: Skyjumper

7. Check if the player is a humanoid

The upgrade function needs to check if the "other" thing that just ran into it is a player or not. Without this check, any random thing could bump into the powerup and you'd get upgraded. With this check, you'll be required to actually walk over to the powerup and touch it to be upgraded.
Starting point file for this challenge

Steps

1. Keep track of whatever object just hit your powerup

We'll keep track of whatever thing hit your powerup with a local variable. We'll call the variable "character" and then set it equal to "other." (Remember, "other" is whatever "other" object ran into your powerup.) 
local character = other

2. Adjust the code to keep track of the parent of that object

Roblox is kind of silly - when an object is touched by a character, the object thinks it only got touched by the arm, and not the entire body. 

If we continued with this code, when we gave your "character" a speed upgrade - it would only make your arm super fast! That doesn't make any sense. 

In Roblox, a character's body is a parent of their arms and legs. So, make your "local character" equal to the "other.Parent." 
local character = other.Parent

3. Search the character object for a "humanoid" object

We still have to double check that it was a player that hit your object. All players in Roblox have something called a "Humanoid" on them, and it holds all the health information of your player. 

So, tell your "character" to run a function called "FindFirstChild" with the parameter "Humanoid" 

character:FindFirstChild("Humanoid")

4. Keep track of the humanoid object by saving it as a local variable

Cool, your code found the "Humanoid" object, but we still have to keep track of it. 

Let's do that by creating another local variable called "humanoid" and setting it equal to the results of that function you just called. 

local humanoid = character:FindFirstChild("Humanoid")

5. Create an if-statement checking if it was a humanoid that touched the powerup

Now we can finally write an if-statement that checks if humanoid is true or not. 

6. Hit return to create an "end" to the if-statement

Anything written in between the word "then" and "end" will be the "then" blank of your if-statement.