Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Selling Strings (https://forums.graalonline.com/forums/showthread.php?t=16016)

mhermher 11-03-2001 01:21 AM

Selling Strings
 
How do i do that if i have 5 iron and want to sell it and i get 1g for each iron,


This is the script for the rocks (where you get the string)

NPC Code:

if(this.mintype==2)
{
if (this.power<=0)
setplayerprop #c, Iron Found!;
setstring Iron,#v(strtofloat(#s(Iron))+1);
this.mintype=0;
}





Can anyone help me make the selling thing?


-EDIT-
I edited the script so its begin eassyer to script, so can anyone PLEASE help?

mhermher 11-03-2001 04:28 PM

Please help me someone!

TDO2000 11-03-2001 09:55 PM

if(playerchats && strequals(#c,sell iron)){
this.priceperiron=5; //change to what u get for iron
if(strtofloat(#s(Iron))>0){
playerrupees+=strtofloat(#s(Iron))*this.priceperir on;
setstring Iron,0;
say2 Here's your money;
}
else {
say2 You have no Iron;
}
}



here we go =)


All times are GMT +2. The time now is 01:22 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.