The problem is that when you use the '.@' sufix, the values will be gone when the script ends. They're not stored. You have to use the '.' to store the values on the NPC variable.
I see that I made some mistakes. I think now It will work:
prontera,150,150,3 script Agent#GiftOnline 832,{
if(getgmlevel()<80)
end;
if(.check==2){
mes "Sir, the gift was delivered successfully";
mes "Wanna do it again?";
switch(select("Yes:No")){
case 1:
next;
goto AGAIN;
case 2:
close;
}
}
AGAIN:
mes "Input item ID:";
input .item;
if(getitemname(.item) == "null") {
mes "Invalid ID "+.item+".";
close;
}
mes "Input quantity:";
input .count,0,30000;
if (.count == 0)
mes "Invalid quantity 0.";
mes "Input the minimum number of Players Online";
input .@i,1,500;
getvariableofnpc(.number,"Check_Players")
close2;
dispbottom .count+" of "+getitemname(.item)+" will be given to players as soon as the Server gets "+.@i+"+ Online =)",0x00FF00;
set .check,1;
end;
OnTimer1:
set .@j,getvariableofnpc(.number,"Check_Players");
announce "Congratulation NameRO for reaching "+.@j+"+ Players !!",bc_all;
sleep 3000;
announce "A little gift for each unique player out there!",bc_all;
if(.check!=2 && .check){
addrid(0);
getitem .item,.count;
detachrid;
.check = 2;
}
end;
}
- script Check_Players -1,{
OnPCLoginEvent:
if(getusers(1)>=.number && .number>0)
initnpctimer "Agent#GiftOnline";
end;
}
So, to test it I add a variable to easily edit the number of players that the script will give the item of choice