Jump to content
  • 0

Request


jayriku12

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  32
  • Reputation:   0
  • Joined:  06/25/12
  • Last Seen:  

Hey! I would like to know how i can have my players wear a special headgear on "Morroc" Town. Which would be called "Bongun Hat" and the ITEM ID number is "5046"

When the Player tries to warp there it will warp them back to Prontera. Please give me full details, this is my first time doing this,

Thanks if your able to help!

Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3123
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

Do you mean if they're -not- wearing the Bongun hat, they'll be warped back to Prontera?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  32
  • Reputation:   0
  • Joined:  06/25/12
  • Last Seen:  

Yes, But if they do have it on they will be able to stay on that map without being warp back to prontera.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

OnInit: setmapflag "morocc",mf_loadevent; end;
OnPCLoadMapEvent:
   if (strcharinfo(3) != "morocc") end;
   if (!isequipped(5046)) {
       dispbottom "You must wear "+getitemname(5046)+" on this map.";
       warp "SavePoint",0,0;
       end;
   }
   if (@morocc) end; // Prevent multiple loops from running
   set @morocc,1;
   while (@morocc) {
       if (!isequipped(5046)) { // Check if the hat is still on
           set @morocc,0;
           dispbottom "You must wear "+getitemname(5046)+" on this map.";
           warp "SavePoint",0,0;
           break;
       }
       if (strcharinfo(3) != "morocc") { // Check if player has left map
           set @morocc,0;
           break;
       }
       sleep2 5000; // Interval for checks
   }
   end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  32
  • Reputation:   0
  • Joined:  06/25/12
  • Last Seen:  

This would be with NPC, or Mapflag?

I keep getting this error either way,

(Debug):mapindex_name2id: Map "Onlnit:" not found in index list!

(Error)Unknown syntax in file >This one< line 1 stopping

w1=OnInit: setmapflag "morroc",mf_loadevent; end;

w2=

w3=

w4=

Edited by jayriku12
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Instead of using:

OnInit: setmapflag "morocc",mf_loadevent; end;  
OnPCLoadMapEvent:  
if (strcharinfo(3) != "morocc") end;  
if (!isequipped(5046)) {  
dispbottom "You must wear "+getitemname(5046)+" on this map.";  
warp "SavePoint",0,0;  
end;  
}  
if (@morocc) end; // Prevent multiple loops from running  
set @morocc,1;  
while (@morocc) {  
if (!isequipped(5046)) { // Check if the hat is still on  
set @morocc,0;  
dispbottom "You must wear "+getitemname(5046)+" on this map.";  
warp "SavePoint",0,0;  
break;  
}  
if (strcharinfo(3) != "morocc") { // Check if player has left map  
set @morocc,0;  
break;  
}  
sleep2 5000; // Interval for checks  
}  
end;

Try using this:

OnInit:
end;

OnPCLoadMapEvent:  
if (strcharinfo(3) != "morocc") end;  
if (!isequipped(5046)) {  
dispbottom "You must wear "+getitemname(5046)+" on this map.";  
warp "SavePoint",0,0;  
end;  
}  
if (@morocc) end; // Prevent multiple loops from running  
set @morocc,1;  
while (@morocc) {  
if (!isequipped(5046)) { // Check if the hat is still on  
set @morocc,0;  
dispbottom "You must wear "+getitemname(5046)+" on this map.";  
warp "SavePoint",0,0;  
break;  
}  
if (strcharinfo(3) != "morocc") { // Check if player has left map  
set @morocc,0;  
break;  
}  
sleep2 5000; // Interval for checks  
}  
end;

Outside of the script at the end:

morocc mapflag loadevent

Peopleperson49

Edited by peopleperson49
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

This would be with NPC, or Mapflag?

I keep getting this error either way,

(Debug):mapindex_name2id: Map "Onlnit:" not found in index list!

(Error)Unknown syntax in file >This one< line 1 stopping

w1=OnInit: setmapflag "morroc",mf_loadevent; end;

w2=

w3=

w4=

set the header!

map,x,y<tab>script<tab>npcname<tab>Spriteid,{

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Nice. I didn't realize that was his entire script. I just thought he was only showing a portion of it. This is a complete script and should work as is for you.

Peopleperson49

- script MocHeadGear -1,{

OnPCLoadMapEvent:
if(strcharinfo(3)!="morocc") { end; }
if(!isequipped(5046)) { dispbottom "You must wear "+getitemname(5046)+" on this map."; warp "SavePoint",0,0; end; }
if(@morocc) { end; }
set @morocc,1;
while (@morocc) {
if(!isequipped(5046)) {
set @morocc,0;
dispbottom "You must wear "+getitemname(5046)+" on this map.";
warp "SavePoint",0,0;
break;
}
if(strcharinfo(3)!="morocc") { set @morocc,0; break; }
sleep2 5000;
}
end;
}

morocc mapflag loadevent

Edited by peopleperson49
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  32
  • Reputation:   0
  • Joined:  06/25/12
  • Last Seen:  

Thank you! Everyone, It works!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

I'm glad it works, but I am curious which version you ended up using?

Peopleperson49

Edited by peopleperson49
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/02/12
  • Last Seen:  

it didnt work for me

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

It works just fine if you put tabs in the header and mapflag. They were there when I put the script there, but I guess the codebox decided it would rather have spaces, lol.

Peopleperson49

script<TAB>MocHeadGear<TAB>-1,{
morocc<TAB>mapflag<TAB>loadevent

Edited by peopleperson49
Link to comment
Share on other sites

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.

×
×
  • Create New...