Jump to content
  • 0

Question

Posted

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!

11 answers to this question

Recommended Posts

Posted
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;

Posted (edited)

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
Posted (edited)

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
Posted

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,{

Posted (edited)

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
Posted (edited)

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

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...