Flashlight wont turn off

**So I got my flashlight addon to work but after adding it to my server it stopped working. It turns on and works fine, but then when I press F to turn it off again it gives me an error.

The error is on top of the paste and I changed the numbers in the error to fit in with the code under it.
http://codepad.org/eFxsoLHX**

You need to store the lamp variable on the player – you are referencing a variable outside of its local scope