Jump to content
  • 0

#CASHPOINTS to Items


lionellex

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  09/10/16
  • Last Seen:  

Hi, I wonder if its possible to change #CASHPOINTS to Gold Coins (7517) ? Or is there any NPC that converts the Gold Coins to #CASHPOINTS ?

 

EDIT: My mistake, what I'm trying to say is, A NPC that converts Gold Coins to Cash Points.

Edited by lionellex
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   431
  • Joined:  01/26/16
  • Last Seen:  

set command is deprecated. Use direct assignment instead.

For example: #CASHPOINTS += (.@amount*10);

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  715
  • Reputation:   83
  • Joined:  01/05/12
  • Last Seen:  

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  09/10/16
  • Last Seen:  

Ops my mistake, what I'm trying to say is, A NPC that converts Gold Coins to Cash Points.

 

EDIT:

prt_in,47,101,2	script	Cash Exchanger	721,{
    mes .NPC$;
    mes "Can exchange your " +getitemname(.ID)+ " for Cash Points. Want to exchange?";
    next;
    if (select("Yes:No") - 1) close;
    mes .NPC$;
    mes "Okay how many " +getitemname(.ID)+ " will you exchange?";
    next;
    input .@amount;
    if (.@amount == 0) {
        mes .NPC$;
        mes "Cannot trade 0 amount";
        close;
    }
    mes .NPC$;
    mes "So you want to exchange " +.@amount+ "x " +getitemname(.ID);
    next;
    if (select("Yes:No") - 1) close;
    mes .NPC$;
    mes "Let me check if you have that amount of requirements";
    next;
    if (countitem(.ID) < .@amount) {
        mes .NPC$;
        mes "Seems like you put an invalid amount";
        close;
    }
    mes .NPC$;
    mes "Ohh that's nice here you go!";
    delitem .ID,.@amount;
    set #CASHPOINTS,#CASHPOINTS+10;
    dispbottom "You now have " +#CASHPOINTS+ " Cash Points";
    next;
    mes .NPC$;
    mes "Success trading";
    close;
    
    OnInit:
        set .NPC$,"[ " +strnpcinfo(1)+ " ]"; // NPC Name
        set .ID,7517; // Requirement
        end;
}

Okay I found this script from THIS thread. I kinda change a little here and there.

Everything works fine, except 1 issue. whenever I give this NPC more than 1 piece of GOLD COIN, it will still give me only 10 Cash Points.

 

How do I set it to give more than just 10 Cash Point when I give this NPC more than 1 piece of GOLD COIN.

Edited by lionellex
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  715
  • Reputation:   83
  • Joined:  01/05/12
  • Last Seen:  

Change this...

set #CASHPOINTS,#CASHPOINTS+10;

to this...

set #CASHPOINTS,#CASHPOINTS+(.@amount*10);
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  09/10/16
  • Last Seen:  

 

Change this...

set #CASHPOINTS,#CASHPOINTS+10;

to this...

set #CASHPOINTS,#CASHPOINTS+(.@amount*10);

Thanks sir, its working now. Thanks a lot.

Edited by lionellex
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  09/10/16
  • Last Seen:  

set command is deprecated. Use direct assignment instead.

For example: #CASHPOINTS += (.@amount*10);

 

Okay so I change

set #CASHPOINTS,#CASHPOINTS+(.@amount*10);

to 

set #CASHPOINTS += (.@amount*10);

like this?

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   45
  • Joined:  08/14/12
  • Last Seen:  

Just put

#CASHPOINTS += (.@amount*10);
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  09/10/16
  • Last Seen:  

 

Just put

#CASHPOINTS += (.@amount*10);

Alright, confirmed working. thanks guys.

Link to comment
Share on other sites

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.

×
×
  • Create New...