I created a button and would like it take different actions
depending on the room in which it is engaged.
For example, if he is in the room 1 then when clicked
the player will go to room 2, but if he is in the room 2
then the player will go to room 3 or if you are in room 3
the player back to room 1 (or go to any other room that I indicate).
(http://i.imgur.com/WQzJEa2.png)
Always grateful for any help or information where
i find a solution for this question! :-D
If this is a GUI button and you want to do this from a global script, you can use player.Room
function btnTeleport_OnClick(GUIControl *control, MouseButton button)
{
if(player.Room == 1)
player.ChangeRoom(2, 100, 50);
else
if(player.Room == 2)
player.ChangeRoom(3, 100, 50);
else
if(player.Room == 3)
player.ChangeRoom(1, 100, 50);
else
Display("No!");
}
Perfect!
(http://www.pixeljoint.com/files/icons/full/purple.gif)
It was exactly what I needed!
Sorry for not mentioning this detail (Gui Button) because at first
it did not seem relevant ... naive mistake on my part, given that it
takes a different condition in Ags.
After all you helped me 2 times!
Thank you very much, Gurok!
;-D