Great Tut Rep++
|
Description: Adding an NPC that gives you a starter pack.
Difficulty: 2/10
Assumed Knowledge: Nothing
Tested Server: Any
Files/Classes Modified: Client.java
Procedure
Step One: Declaring.
Declare this underCode:public class client extends Player implements Runnable {Step One: Declare this aswell.Code:public int starter = 0;
Add this to case 155, thx hoodlom, even though you hate me?
What this does is, if you do not have a starter, if(starter == 0) { then it will add any items you wan't it to add. then, when it says } else if(starter == 1), its saying that you already have a starter, and you cannot receive another one.Code:if(NPCID == ID OF NPC) { if(starter == 0) { start = 1; addItem(itemid, itemamount); addItem(itemid, itemamount); and so on.... } else{ sendMessage("You Already Have Your Starter!"); } }
Thanks.
Credits:
100% Me.
Great Tut Rep++
Thanks. :]
Ehh.... Terribly Done... Logout And In And You Could Get A New Starter... And Try This In Case 155 Instead
Also f1r3c4p3, I Have Always Hated You, If You Are Going To Leech, Atleast Do It Correctly. Also, If This Is Your Work, I Will Crap Myself Laughing At You.Code:if(NPCID == idyouwant) { if(starter == 0) { starter = 1; addItem(itemid, itemamount); addItem(itemid, itemamount); and so on.... } else{ sendMessage("You Already Have Your Starter!"); } }
Your lucky, i added the right tags for you and bolded them.
Please do this in the future.
LOL? How is this leaching? And don't post if you hate me?
Thanks.
It's really annoying to see two different structures in between tutorials.
You need to add it in the starter int in the player saves.... lol Or just make it were you teleport off of like tutorial island so you can never kill it again....
No You don't cause it saves to your savedgames. Trust me try it.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |