The final price used for settling option contracts is calculated based on the weighted average of all trades in the underlying option during the last half hour of trading.
However, the last traded price (LTP) cannot be zero as you cannot place a trade at ₹0 on the exchange. If the option itself is worthless i.e out-of-the-money on the day of settlement, even if its LTP is ₹0.05 its settlement price comes out to be ₹0.