NPC sleep

How do i make an npc AI sleep then awake at will with lua?