Coding a sleep command in inform7: help needed urgently

Within certain parts of my game the player needs to sleep in order to reach a dream like city. the first part of my code allows the player to do this once they have met the certain conditions (see code) but once they come out of this place, they can instantly go back in using the ‘sleep’ command (which i am trying to restrict to certain conditions). Here is a sample of my code: Instead of player sleeping: say "despite feeling tired you resolve to investigate other area's of the hospital, your mind unsatisfied with your results and physical evidence thus far..."; if allowing-sleep is true and drug-vial-obtained is true: say "you lay down gently, your mind switches off as your body lays heavily. Falling steadily into unconsciousness, a mixture of bright and dull lights play out behind your eyes...your dream about to begin"; move player to dreamscape; If dream-night is true and joseph-convinced is false: say "despite feeling tired you resolve to investigate other area's of the hospital, your mind unsatisfied with your results and physical evidence thus far..."; if dream-night is false and joseph-convinced is true: say "despite feeling tired you resolve to investigate other area's of the hospital, your mind unsatisfied with your results and physical evidence thus far.."; if dream-night is true and joseph-convinced is true: say "Gently falling in to a deep sleep you instantly feel the hallucinogen ignite in your belly, blood pumping around your body and heart faster than you've ever felt. Consciounsess quickly slipping from reality your eyelids close over as you brain begins to rest, your spirit transported to the mysterious saturated dreamscape..."; move player to dreamscape; move Joseph to the graveyard west; move Boston to the bridge to the outskirts; now night-two is true.

The player can enter the dreamscape whenever they want (after the first entry) i desperately need to stop them entering it on the second try without fullfilling the conditions. any help is welcome thankyou

Is the problem that the allowing-sleep flag remains set?
Then reset it to false at some appropriate time.

[...]
	if allowing-sleep is true and drug-vial-obtained is true:
		say "you lay down gently, your mind switches off as your body lays heavily. Falling steadily into unconsciousness, a mixture of bright and dull lights play out behind your eyes...your dream about to begin";
		move player to dreamscape;
		now allowing-sleep is false;
[...]

I think you are correct. i implimented your idea and it appears to be working (we’ll see heh) but thankyou sometimers the obvious things slip my mind when im this stressed so thanks a ton :slight_smile: