Disabling 'Ask/Tell' Temporarily

Is there a way to disable the 'Ask/Tell' function temporarily? For instance, if a player is a ghost and cannot interact with people? Disabling the function would be so much easier than adding "if player.ghost" before everything.

Similarly, is there a way to disable 'Ask/Tell' functionality for only a specific NPC?

Best way would be to over-ride the ask command. Create a a new command, set the pattern in the dropdown to "regular expression". Put in this pattern:

^ask (?<object>.*) about (?<text>.*)$

Call it "ask2". For the script, paste this in:

if (player.isghost) {
  msg("Cannot ask when ghost.")
else {
  DoAskTell (object, text, "ask", "askdefault", "DefaultAsk")

Thank you! I'll give this a try.

This topic is now closed. Topics are closed after 60 days of inactivity.