I decided to just have it stay in the players inventory, and the below code now works.
Code:
if %cmd.mudcommand% == enter && %arg% /= gateway
%send% %actor% You enter the gateway.
%echoaround% %actor% %actor.name% bravely enters the gateway.
%teleport% %actor% 7798
%force% %actor% look
%echoaround% %actor% %actor.name% just stepped through the gateway.
else
%send% %actor% %cmd% what?!
end
Now that the character has been transferred to a new room, I need to be able to send them back to the room they came from, so if the player started in room 3000 and used 'enter gateway' they are now in room 7798, I need to make it so when they type 'exit gateway' it takes them back to room 3000, or whatever room they were initially in.
Maybe I could add a Global variable in the first script like:
Code:
global original_vnum = %self.vnum()%
if %cmd.mudcommand% == enter && %arg% /= gateway
%send% %actor% You enter the gateway.
%echoaround% %actor% %actor.name% bravely enters the gateway.
%teleport% %actor% 7798
%force% %actor% look
%echoaround% %actor% %actor.name% just stepped through the gateway.
else
%send% %actor% %cmd% what?!
end
Then from a 2nd script on the object, use that global like:
Code:
if %cmd.mudcommand% == exit && %arg% /= gateway
%send% %actor% You enter the gateway.
%echoaround% %actor% %actor.name% bravely enters the gateway.
%teleport% %actor% original_vnum
%force% %actor% look
%echoaround% %actor% %actor.name% just stepped through the gateway.
else
%send% %actor% %cmd% what?!
end