Welcome to the forums mtdwgjm
It depends if you are using the free version and are working without coding, or if you have the full version and use VBScript.
Go to the hotspot properties of the hotspot with the key, and set "Change the value of the variable to 1 when the hotspot is clicked" on the Variables tab.
After that:.
Without coding:
Make 2 hotspots over the door:
Create one hotspot, then go to the hotspot properties; go to the Variables tab, and set it to be visible if the variable is =1. Then go to the General tab, and set to which frame the player should go.
Create a second hotspot (on top of the first hotspot), and set it to visible if the variable=0. Then check the "Display a message" on the Actions tab, and add your message there.
With script:
Create one hotspot over the door, go to the Advanced tab of the hotspot properties, and add:
- Code: Select all
If MyVariable=0 Then
Message "The door is locked."
Else
Action.GoToFrame "Frame_Name"
End If
whereas MyVariable can be replaced by the custom name of your variable, and Frame_Name by the custom name of your frame.