Jump to content

Luciar

Support Leaders
  • Content Count

    45
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Luciar


  1. 9 hours ago, Kuroe said:

     

    
    -	script	Sample	FAKE_NPC,{
    OnInit:
    detachrid();
    .cdtime = 24*60*60;
    for (set .accid, 2000009; .accid<=2000030 ; .accid++)
    end;
    OnPCLoginEvent:
    attachrid(.accid);
    if (#gotone + .cdtime> gettimetick(2)) {
    	dispbottom "Daily reward have been distributed";
    	end;
    }
    else {
    	dispbottom "An apple a day takes the doctor away.";
    	getitem Apple,20;
    	#gotone = gettimetick(2);
    	end;
    }
    }

     

    Thanks for trying to help the OP. However, this script isn’t written correctly.

    The OnInit label inherently does not have an attached RID, using detachrid() is pointless.

    You then use a for loop without any defined action: syntax for(index set; condition; increment) { action }
    Note that you are missing the action portion of the for loop.

    The OnPCLoginEvent label inherently DOES have an RID attached (namely, the player that just logged in). There is no need to use attachrid here.

    If you were to fix all of the issues I listed above, your script would distribute the items to all accounts as you have not implemented any check to ensure the account ID is within the specified range described by the OP.


  2. The script provided in Hercules looks fine. Did you reload scripts or restart your server after adjusting the .faileddestroy variable?

    Make sure you are running a recent version of Hercules. Although the script_command doc has not been updated to include failedremovecards's second argument being set to 3, it is defined in source as

     

    /// Removes all cards from the item found in the specified equipment slot of the invoking character.
    /// failedremovecards(<slot>, <type>);
    /// <type>=0 : will destroy both the item and the cards.
    /// <type>=1 : will keep the item, but destroy the cards.
    /// <type>=2 : will keep the cards, but destroy the item.
    /// <type>=3 : will just display the failure effect.

     

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.