Also - the instructions in your if statement aren’t wrapped in { } so it will only execute line 4 when the statement is true - therefore line 5 is always out of scope and doesn’t know what script2 is. Lastly - GetComponent will return null if there is no component of that type on the object.
I just tried that and it gave an error :
Assets/testno15.js(9,63): BCE0019: ‘GetComponentmoveandjump’ is not a member of ‘UnityEngine.GameObject’. Did you mean ‘GetComponent’?
thanks Kelso that fixed it, I’m gonna read some more about if and else statements now, I wasn’t aware of that, I thought it was just a shortcut to apply if you only got the if statement to excecute