Jump to content
  • 0

Gold room check weight


Question

Posted

Help me with my script. When a player farmed a lot of gold points, he can't trade it with gold because he will be overweight. can someone please fix my script with a limit of golds to farm inside gold room and he will be warned that he may not carry all those golds when exchanging it.

goldroom.txt

4 answers to this question

Recommended Posts

  • 1
Posted

a more practical method should be asking the player to trade how many golds he want

change the exchange: label into like this

exchange:
	mes "[Gold Room Warperer]";
	mes "Hmm...let me see";
	mes "You have " +gold+ ".";
	if (gold == 0) goto nogold; 
	mes "how many you want to retrieve ?";
	next;
	input .@tmp, 1, gold;
	if (checkweight(969,.@tmp) == 0) goto L_OverWeight;
	getitem 969, .@tmp;
	set gold, gold - .@tmp;
	emotion e_gg;
	end;
  • Upvote 2
Posted

Add after : 

dispbottom "-|You got: " +@gain+ " gold| - |Total: " +gold+ " gold|- ";

This : 

if ( ( gold % 20 ) == 0 ) 
    dispbottom "[Warning]: You may not carry all those golds when exchanging it";
Posted

If the gold he gain is divisible by 20 then the dispbottom command will be triggered.

 

20 | 40 | 60 | 80 | 100 ....

 

but i think my approach is not good since u are using rand() command.

 

Change that to :

if ( gold > 20 ) 
     dispbottom "[Warning]: You may not carry all those golds when exchanging it";

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...