i want to make NPC auto give but error like this
[Error]: script_rid2sd: fatal error ! player not attached!
[Debug]: Source (NPC): dmdmswd at prontera (0,0)
[Warning]: script:get_val: cannot access player variable 'domswd', defaulting to 0
this is idea :
- NPC random time every 7 day to player who online except in vending,
- if player not online or online that item will delete automatically before random player get that.
- if player die item will lost.
- player who have that item can kill by other player
- if other player kill that player who have that item, other player will have that item.
- item can't be taken off, after equipped.
help me what should i do with my script ?
this is my start script
prontera,0,0,0 script dmdmswd -1,{
OnInit:
OnClock0000:
set .DmdTime,rand(24);
OnMinute00:
if( gettime(3) == .DmdTime ){
set .DelayMin,rand(60);
sleep ( .DelayMin * 60000 * 7 );
while(1){
query_sql "select account_id from 'char' where online = 1 order by rand() limit 1", .@onl;
attachrid .@onl;
if( CheckVending() ){
DetachRID();
continue;
}
announce strcharinfo(0) +" won in 666 Sword.", 0;
query_sql "DELETE FROM Inventory WHERE nameid='27666'";
getitem 27666,1;
set domswd, 1;
break;
}
}
if (domswd >= 1){
OnPCDieEvent:
dispbottom "Holy Shit you died!";
dispbottom "Your Weapon will gone!";
query_sql "DELETE FROM Inventory WHERE nameid='27666'";
set domswd, 0;
end;
}
end;
}
i'm sory my english not good
[solved] invalid syntax