- 7
- Posts
- 5
- Years
- Midwest, USA
- Seen Mar 20, 2024
Hi all,
This is probably a relatively novice subject, but I'm still inexperienced with scripting. I'm struggling with writing a script at the moment that would prevent the player from leaving a mansion without first traveling through it and interacting with a certain NPC. I tried multiple variations of setting a flag when the interaction with the NPC takes place and running a flag check when trying to leave, but it freezes my game every single time without fail, no matter what flag I set.
Specifically, what I'm trying to accomplish is this:
If the player tries to leave the mansion without interacting with the NPC first, he will stop, say something along the lines of "I can't leave yet, I still have to find [insert name of old man here]", then turn around and move backwards back away from the door.
If the player has already completed the interaction, I'd like nothing to happen at all and the player to exit the mansion normally.
Does anyone have an example script I could potentially bum, or could anyone explain this to me? Your help would be greatly appreciated.
Thank you!
This is probably a relatively novice subject, but I'm still inexperienced with scripting. I'm struggling with writing a script at the moment that would prevent the player from leaving a mansion without first traveling through it and interacting with a certain NPC. I tried multiple variations of setting a flag when the interaction with the NPC takes place and running a flag check when trying to leave, but it freezes my game every single time without fail, no matter what flag I set.
Specifically, what I'm trying to accomplish is this:
If the player tries to leave the mansion without interacting with the NPC first, he will stop, say something along the lines of "I can't leave yet, I still have to find [insert name of old man here]", then turn around and move backwards back away from the door.
If the player has already completed the interaction, I'd like nothing to happen at all and the player to exit the mansion normally.
Does anyone have an example script I could potentially bum, or could anyone explain this to me? Your help would be greatly appreciated.
Thank you!