Jump to content
  • 0

OnPCLoadMapEvent


Question

Posted (edited)

- Does anyone know how to effectively use this script? Mine doesn't seem to want to work. Just simple things like map ejection when requirements are not met, etc etc.

- Heres my code snip.

- script Map Guard:mgr01 -1,{
OnPCLoadMapEvent:
getmapxy(@mapname$,@mapx,@mapy,0);
 if(@mapname$ == "xanhart01"){
  if(lostinforest!=2) warp "prontera",141,229;
  end;
 }
 if(@mapname$ == "xan_fild01"){
  if(forestfallen==1)end;
  dispbottom "You wake up in a mysterious forest";
  set forestfallen,1;
  end;
 }
end;
}
xanhart01 mapflag loadevent
xan_fild01 mapflag loadevent

- Do i have to attachrid? [dont know how to use that]

- Also tried replacing to : if(strcharinfo(3) == "xan_fild01"){

if(forestfallen==1)end;

dispbottom "You wake up in a mysterious forest";

set forestfallen,1;

end;

}

- still doesnt work.

Edited by Leehalt

2 answers to this question

Recommended Posts

Posted

what is not working in the script ???

if(lostinforest!=2) warp "prontera",141,229;

it will only warp the player back to prontera if the variable condition matched...

 if(forestfallen==1)end;
  dispbottom "You wake up in a mysterious forest";

a message will be display if your variable forestfallen not equal to 1


- Do i have to attachrid? [dont know how to use that]

read this Attachrid

Posted (edited)

- if(lostinforest!=2) warp"prontera",141,229; <--- doesnt warp people out, and as I understand, this reads: if lostinforest variable is NOT equal to 2, warp to prontera.

- if(forestfallen==1)end; // meaning nothing will happen if this occured once already

dispbottom "You wake up in a mysterious fores"; // doesnt pop out even if variable is equal to 1

set forestfallen,1; // makes it so it doesnt always dispbottom when people load this map.

======================================== edit ====================================

- solved my own problem, thanks for trying to help.

Edited by Leehalt

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...