An easy way to add a lock to any script