Immobilizing a player

Forgewright
28 Jun 2015, 05:11My player is a creature which can turn to stone. When in this state he is unable to move or give any commands except the command to "turn" back to flesh. The game can give him input when he is stone and he can see things around him. I need a function to call to freeze the players inputs unless it is the command "turn". When flesh and the player "turns" to stone this is the script.
This is the attribute flagging the state the player is in.

if (IsSwitchedOn(player)) {
msg ("Let's just agree that turning to stone while flying is not your best option.....")
}
else if (player.turn = "Stone") {
msg ("You turn from stone to flesh and are able to continue.")
set (player, "turn", "Flesh")
}
else {
msg ("You hunch over and turn to stone.")
set (player, "turn", "Stone")
}
This is the attribute flagging the state the player is in.
The Pixie
28 Jun 2015, 08:55
Forgewright
28 Jun 2015, 12:50So simple...no wonder I couldn't think of it. Thanks Pixie. I see why I couldn't find it. The title is spelled immobilised...lol
adammadam
28 Jun 2015, 18:16Forgewright wrote:So simple...no wonder I couldn't think of it. Thanks Pixie. I see why I couldn't find it. The title is spelled immobilised...lol
yeah i think its all in british english so bear that in mind!!!

Forgewright
30 Jun 2015, 19:17Well, I used something new to me called the function to get the result I wanted to immobilize/immobilise a player. I named the function 'transform' and placed a call function at the end of the above 'turn' command script.
this brings up the function and I call itself again in the last line of the function, looping the code until the player types in 'turn'. since that is the only action they can take until they are flesh again. Only took a couple days but I figured it out.
get input {
if ( (result = "turn") ) {
msg ("You turn back to flesh.")
set (player, "turn", "Flesh")
}
else {
msg ("You are stone and can not do anything until you are flesh again.")
transform
}
}
this brings up the function and I call itself again in the last line of the function, looping the code until the player types in 'turn'. since that is the only action they can take until they are flesh again. Only took a couple days but I figured it out.
