Jump to content
  • 0

script that turns money into a token (bag of coins or coins) every 30 minutes, while on autotrade or on merchant designated map


Question

Posted

Being sincere i have no idea how to begin to design this so any clue on how to start or similar functions to modify are more than welcome.

1 answer to this question

Recommended Posts

  • 0
Posted
-	script	SHOP_COIN_CONVERTER	-1,{
	OnInit:
		.exchange_item = 501;
		.conversion_rate = 1000; // 1000 to 1.

		initnpctimer;
		end;

	OnTimer1800000:
		// Reset the timer.
		initnpctimer;

		// Add all players on the server to the script.
		addrid(0);

		// Check if the player is autotrading and exit if not.
		if(!(checkvending(strcharinfo(0)) & 2)) end;

		// Convert .conversion_rate zeny into amount to exchange.
		.@exchange_amount = floor(Zeny / .conversion_rate, 1);

		// If the exchange amount is below 1 exit.
		if(.@exchange_amount < 1) end;

		// If the player can't carry all the items exit.
		if((getiteminfo(.exchange_item, ITEMINFO_WEIGHT) * .@exchange_amount + Weight) > MaxWeight) end;

		// Subtract zeny.
		Zeny -= .@exchange_amount * .conversion_rate;

		// Handout the item in .@exchange_amount.
		getitem(.exchange_item, .@exchange_amount);
}

 

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...