Thread: Smithing help!

Results 1 to 2 of 2
  1. #1 Smithing help! 
    Registered Member
    Core's Avatar
    Join Date
    Sep 2007
    Posts
    4,194
    Thanks given
    11
    Thanks received
    393
    Rep Power
    1985
    Alright so I am fixing up smithing on my server and I want to make it almost exactly like rs.
    so I have 2 problems.

    1. How would I right this to make it so you get iron bar 50% of the time.. like this?
    Code:
    if(UsedOnObjectID == 3994 && ItemID == 440 && playerLevel[13] >= 15){
    deleteItem(440, 1);
    addItem(2351, 1) + misc.random(50);
    sM("You smith the iron ore.");
    setAnimation(899);
    faceNPC(UsedOnObjectID);
    addSkillXP(2500, 13);
    } else {
    sM("You need 15 smith to do this.")
    }
    2. How do I make it so for like smelting rune you have to have like 8 coal.. like this?
    Code:
    if(UsedOnObjectID == 3994 && ItemID == 451 && playerHasItem(453) && playerLevel[13] >= 85){
    deleteItem(451, 1);
    deleteItem(453, 8);
    addItem(2363, 1);
    sM("You smith the runite ore.");
    setAnimation(899);
    faceNPC(UsedOnObjectID);
    addSkillXP(12000, 13);
    } else {
    sM("You need 85 smith to do this.")
    }
    Please Help.
     

  2. #2  
    Banned

    Join Date
    Jul 2008
    Age
    26
    Posts
    5,826
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    well im to tierd to tell you everything, but heres how you do random,

    Code:
            int i = math.random(2);
        if (i = 1) {
           addItem(iron bar here);
           sM("you smelt a bar");
      }
        if (i = 2) {
           sM("Noob you suck & fail at life, you you dont get a bar..");
      }
    and you should have a void like addItemAmount(item here, amount here); and playerHasITemAmount(item here, amount here);
    or something like that...
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •