Overweight + Open a Box Contain 100 Ygg

ThyroDree

New member
Messages
556
Points
0
Location
Philippines
Github
bosxkate23
Emulator
help me  if the player is Overweight and Open a Box Contain 100 Ygg how can i make it not drop i will direct put on storage?

is this possible?

 
Script

[cbox]function script checkweight {

setarray .@item[0],607; <- Ygg
setarray .@quantity[0],500; <- Quantity
setarray .@returnit[0],501; <- Change it to itemid Yggdrasil box
if( checkweight2( .@item,.@quantity ) ){
getitem .@items,500;
}else{
mes "You are overweight.";
getitem .@returnit, 1;
close2;
}
}[/cbox]

Item Script

[cbox]{ callfunc "checkweight"; },{},{}[/cbox]

try this

 
Last edited by a moderator:
is this auto direct on storage?
oops sry i misread ur post.

nope its not, but instead of directing in storage, it will return the box.. and will pop up a msg you are overweight..

sry im just starting my career in script writing.. idk if there is a script com. that will direct the item to storage.

 
is this auto direct on storage?
oops sry i misread ur post.

nope its not, but instead of directing in storage, it will return the box.. and will pop up a msg you are overweight..

sry im just starting my career in script writing.. idk if there is a script com. that will direct the item to storage.
Okay i think i will use this
default_smile.png
hope it will work  ill give u an ^

 
^ this is only for ygg. but if i got Box of Thunder Box, Yggseed Box, Speed pot Box,etc.,

can u make a Overweight detection? if ur Overweight u cant open boxes.
default_smile.png


 
^ this is only for ygg. but if i got Box of Thunder Box, Yggseed Box, Speed pot Box,etc.,

can u make a Overweight detection? if ur Overweight u cant open boxes.
default_smile.png
wee
default_biggrin.png
im lack of knowledge. to squeeze the script and put alot of items that u want to be checked.

ok, u can try doing this until someone will give a better script

duplicate the script in the same .txt so less npc.txt to read

add this and change,

[cbox]function script seedbox {[/cbox]

change this depending on the items that are in the attached box

[cbox] setarray .@item[0],607;

setarray .@quantity[0],500;

setarray .@returnit[0],"box id"; <-Remove qoutations.

[/cbox]

and last is in item script 

[cbox]{ callfunc "seedbox"; },{},{}[/cbox]

and so on and so forth for the rest box..

that's what im doing if i want to add more box to check.. just wait for someone to provide a better script than this unoptimized one..

 
Last edited by a moderator:
function script boxweight { //callfunc("boxweight",ItemID,Quantity,BoxID)if (checkweight(atoi(getarg(0)),atoi(getarg(1)))){ getitem atoi(getarg(0)),atoi(getarg(1));}else{ getitem atoi(getarg(2)),1;}end;}Replace spaces with tab,(And suddenly i realize, i cant type tab button in mobile)Usage: on item script, put

callfunc("boxweight",ItemID,Quantity,BoxID)

And only change itemid,quantity and boxid,

P.s:added atoi since many here put quotes.

 
Last edited by a moderator:
Back
Top