Require an item to rest

Make sure the PCs have a certain Item in possession before resting
In the Module properties under the "Events" tab is a script handle marked OnPlayerRest. This is where you can make scripts to do things to the PC when they start to rest, end their Rest, or Cancel their rest.

This is a basic script that will check for an Item the PC must have to be able to rest. The Item in this example is FOOD. Change that to the TAG of the item you are looking for. Or you can eliminate / add to the list.

void main {   object oPC = GetLastPCRested; object oFood = GetItemPossessedBy(oPC,"FOOD"); if(GetLastRestEventType == REST_EVENTTYPE_REST_STARTED) {       if(!GetIsObjectValid(oFood)) {           // This will prevent him from resting AssignCommand(oPC,ClearAllActions); // Add more conditions here. }       } }

Note
Canceling the PCs rest in this fashion will also trigger the REST_EVENTTYPE_REST_CANCELLED