Asking a question

Hippyonastick
I know that there's an if 'play answers yes...' option under the if section, but an intrusive popup appears so as to answer the question. Is there a way to ask a question without this happening.

Thank you,
Steven

sgreig
Of course. Use a get input function to get the player's response and then use an if statement to check what they typed.

Hippyonastick
Thanks. But how do I enter into the if statement to correspond with the player response? (sorry i'm new to this and scripting...)

sgreig

msg ("Ask player random yes or no question.")
get input {
if (result = "yes") {
msg ("Hooray!")
}
else {
msg ("You suck!")
}
}

The Pixie
I would suggest modifying it so that:

if (result = "yes") {

becomes

if (StartsWith (LCase (result), "y")) {

This will then interprete "Yes", "yay", "Yeah" and "y" to mean yes too.

sgreig
The Pixie wrote:I would suggest modifying it so that:

if (result = "yes") {

becomes

if (StartsWith (LCase (result), "y")) {

This will then interprete "Yes", "yay", "Yeah" and "y" to mean yes too.


Good call. :)

Hippyonastick
Thank you, it worked perfectly!

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

Support

Forums