[REDACTED 8811]

Hi!

I tried to search the code for something with c.delete or this.delete but could not find a thing.
I tried to look over the consumables, but I wouldnt find anything called delete in the scripts.


I am still learning C#, so my questions may seem stupid.

Im trying to make an item break after you double click, and let it drop something random (dont have a list yet)

Example 1:
public override void OnDoubleClick( Mobile from )

RandomSomethingInbackPack


this.delete();

You get my idea, I am just curious what the correct format/code would be for an item to break on click really :D
 
It depends on if the item you are doubleclicking is stackable or not.

If it is not stackable, then this will work:

this.Delete();

But if the item is stackable, then you have to decide what if someone doubleclicks a whole stack of this item? In that case you need to determine how much will be deleted. For example, lets say it's some kind of stackable item like coins or a resource. Then you would use this:

this.Consume(50);

Where 50 is the amount to consume in this example.
 
the D has to be capitalized.
c.Delete();
this.Delete();
Delete(); //don't really need this.
It depends on if the item you are doubleclicking is stackable or not.

If it is not stackable, then this will work:

this.Delete();

But if the item is stackable, then you have to decide what if someone doubleclicks a whole stack of this item? In that case you need to determine how much will be deleted. For example, lets say it's some kind of stackable item like coins or a resource. Then you would use this:

this.Consume(50);

Where 50 is the amount to consume in this example.


Thank you a bunch!
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back