Why does this code work...
Code: ags
But this code doesn't...
Code: ags
I want the script to check the position of my character before he can sit on the couch. If he is close enough he will be able to sit on the couch when it is clicked again. This code works fine when I want to change rooms and I also like the freedom of walking without eblock.
function hBedroomDoor_Interact()
{
if(Character.GetAtScreenXY(90, 210)==cSlade)
{
player.ChangeRoom(2, 200, 265);
}
else if (player.View==2)
{
player.ChangeView(1);
player.Walk(90, 210);
}
else
{
player.Walk(90, 210);
}
}
But this code doesn't...
function hSladesCouch_Interact()
{
if(Character.GetAtScreenXY(210, 260)==cSlade)
{
player.ChangeView(2); //to sit on couch
SetWalkBehindBase(1, 200);
}
else
{
player.Walk(210, 260);
}
}
I want the script to check the position of my character before he can sit on the couch. If he is close enough he will be able to sit on the couch when it is clicked again. This code works fine when I want to change rooms and I also like the freedom of walking without eblock.