Improved weapon script to support single player.