[Guide/Add-on] Popup

Newbie Spellweaver
Joined
Jan 25, 2011
Messages
14
Reaction score
6
This is kind of a guide, but its also a release o-O

Umm, if the mods feel this should go in the Tutorial section, can you please move it? Ok on to the relase/tut.

I am basically here to teach you how to make an effect or an NPC pop up when a user first enters the map (similar to that annoying cygnus pop up).

Step 1: Go into your server folder and find the "scripts" folder.

Step 2: From here double click on the "map" folder you find, you should see 2 folders now.
Code:
onFirstUserEnter
and
Code:
onUserEnter
, or something similar to this.

Click on the onUserEnter folder, now you should see a couple files, ignore those.

Step 3: Open your NotePad++, your NotePad, your JS Editor or whatever you want and proceed to make a new file, call it whatever you want.

Step 4: Now there are several things you can do from here, such as make an effect happen, make something spawn, or whatever you want. The most important thing you can do here, is add checks. Here are some examples:

PHP:
function start(ms) {
    if (ms.getPlayer().getMap().getId() == 0)

The above, checks for the map id, Feel free to change the blue 0 to whatever you want the map id check to be. You can also check for statuses, user level, user job or whatever you want.

Final Step: Now You can make something happen, I will be showing you how to 1. do an effect and 2. open an NPC.

TO OPEN AN NPC

Code:
Packages.scripting.npc.NPCScriptManager.getInstance().start(ms.getClient(), [color="red"]Your NPC Id here[/color], null, null);

Change the "your npc id here" to whatever npc you would like to open. To cause an effect you would do something like this.

Code:
ms.getPlayer().getMap().startMapEffect("Ha! Let's see what you got! I won't let you leave unless you defeat me first!", 5120024);
    }

Now the above code, I didnt right, its just an example from the dojo script :D:


I'll see you later guys, appreciation would be nice. :lol:

Enjoy.

}
 
Last edited by a moderator:
This doesn't work at all. That's like naming a npc script anything you want. Anyways why the new account?
 
Chris you remember how I made was working on the team system. Well this should make the NPC auto pop-up like I was going for.
 
This was released before.

Instead of releasing tiny things, maybe you should focus on something a bit more useful and unique..

New account? What do you mean o-o
You know, it's not hard to smell an attention seeker.

PHP:
function start(ms) {
    if (ms.getPlayer().getMap().getId() == [color="blue]0[/color])

Are you kidding me? ROOFLL.
 
Last edited:
It doesn't even work. Can you name portal scripts anything? Same concept here. Only certain scripts will work.
 
you can make it work by editing the XML of the map and adding/editing the OnUserEnter property....

still a stupid release though... if you need a tutorial for this you shouldn't run a server in the first place...
 
you can make it work by editing the XML of the map and adding/editing the OnUserEnter property....

still a stupid release though... if you need a tutorial for this you shouldn't run a server in the first place...

You have problems bro. I don't see you doing anything constructive. If you want to troll, have a reason. :thumbdown:
 
Can someone confirm if this work, I'm not allowing any untested things to be in my library..

Anything released by Soulfist, Reverse or Literal is not working. I'm sorry. :'<

This won't works due to what SuperLol said, it doesn't even explain a thing about how the files are being loaded based on the info at the WZ, which is actually the most important step. Also, this doesn't even say anything useful.
 
Back