Ok, so i’m trying to learn javascript, but its really hard for me to learn. If I create a problem, i sometimes can correct it, but when I do fix them they sometimes lead to more problems. So here is the script. I need a script that will tell the gun which is attached to the character controller to play the gun animation which is sprint [LeftShift]
Script Ex:
If (KeyDown) “Shift”
var Play.Animation();
I’m sorry if this script makes no sense. Can anybody help me?
Here are a few things you have to learn, according to your example, but I’m sure you know that there is still a lot more to look at 
- if(condition)
Everything that’s part of the condition is within the brackets, not after it.
- var variable
var is the keyword for creating a variable, something that can remember something, like a number or an object.
You don’t want to remember something here but simply do something (start the animation), so you don’t need a variable here. No var keyword.
- thing.member
Before the point is the thing you want to do something with, after it comes the member (method you want to call or variable you want to use).
So it’s not Play.animation() but animation.Play().
- Input.GetKeyDown
The KeyDown method is part of the Input class so you have to use it that way.
Your code should be:
if(Input.GetKeyDown("left shift"))
{
animation.Play();
}
…and this has to go in the Update function.
Go look for some tutorials, people won’t always give you working scripts for pseudocode.
Thank you so much, i’ll do some research. 
Oh wait, can I add var at the start of the 3rd line to make it so i can select the animation myself?
You should really complete a few tutorials on basics first, making assumptions on how everything works will get you nowhere 