Check whether a creature is resting.
Creature to be checked. (Default: OBJECT_SELF)
Returns TRUE if oCreature is currently resting. Otherwise, returns FALSE.
Note that applying effects such as EffectSleep() or animations such as ANIMATION_LOOPING_SIT_CROSS do not count. Only if a PC has selected his or her "rest" function, or if an NPC has been given the ActionRest() script command will this function return TRUE.
Prior to 1.28, this function always returned FALSE if called outside of the event OnPlayerRest.
// will go "bonk some 'eads!"
// Get creature perceived
object oSeen = GetLastPerceived();
// Get is can see it, or rather, we can now see it. Must also be a PC.
if(GetLastPerceptionSeen() && GetIsPC(oSeen))
// Lets go bonk their head if they are resting
SpeakString("'ere, you need bonking on der 'ead!");
author: Jason Harris, editor: Jasperre