Water Works LS2 Addon LUA Fixing

Hello, I run a spacebuild server and I am attempting to fix a few broken Life Support 2 addons for use on the server. I’ve run into a problem with an entity on the mod “Water Works” made by PhonicUK,
the origional addon can be found at http://www.facepunch.com/showthread.php?p=7254779. The code I have begun to modify to get it working again is here http://pastebin.com/m4cd7d791. The problem is in line 65, I can’t figure out what exactly is causing it. Help?

What does it do wrong?

“11th September 2007”

self.environment.inwater likely isn’t defined.

This has been fixed. Self.environment.inwater tends to not work sometimes so I replaced it with self:WaterLevel() > 0. I’m going to try to get permission from PhonicUK to release it since aparently he isn’t going to fix it himself.