How should i end this script?

so this is my script.

i don’t really know why it counts the end of the script as spelt wrong.
also I’m a beginner for scripting so yeah, maybe if there’s an article about end parts please let me know.

I accidentally typed. sorry

You require a parenthesis to close the :Connect( on MouseClick, this parenthesis can be placed on the first end.

Your missing a bracket to end your other function.

I’m not exactly sure what you mean by that one…
can you please give an example?

You are also missing a condition before the else in the if statement.

Also, you don’t need the if statement in the first place since you are checking what a variable is, when you set it to a constant value on the line above.

I fixed by re-writing the code. thank you for having interest in helping out!