- 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.
and
, 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:
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
Change the "your npc id here" to whatever npc you would like to open. To cause an effect you would do something like this.
Now the above code, I didnt right, its just an example from the dojo script
:
I'll see you later guys, appreciation would be nice.
Enjoy.
}
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
Code:
onUserEnter
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
I'll see you later guys, appreciation would be nice.

Enjoy.
}
Last edited by a moderator:

