If statement

I would like some help about the if statement, I can not get it to work, here is my code.

If the player carries the master key; say "Now I can get out.".

Thank You

change your semi-colon to a colon.

Also, bear in mind that all such statements have to be part of rules, which tells the game when or where this happens.

Such as:

Every turn when the player carries master key: say "Now I can get out."

Report going when the player carries master key and the location is Near the Locked Gate: say "Now I can get out."

You can still have “proper” if statements, though, as long as they’re part of a rule.

Check jumping: if the player is on the balcony: say "The balcony is slick with rain, making it unsafe to jump."; stop the action.