Vanquisher
Initiate
how can i setup a item to be consumed and the player moved to a location
how can i setup a item to be consumed and the player moved to a location
public override void OnDoubleClick(Mobile from)
{
base.OnDoubleClick(from)
}
public override void OnDoubleClick(Mobile from)
{
base.OnDoubleClick(from) // The base classes OnDoubleClick method code gets called here before yours.
if (from != null) //Get into a habbit of using this, as you may encounter null reference errors if you dont. Your basically making sure when the player clicks this item, they aren't null, otherwise itll cause a null reference exception.
{
from.MoveToWorld((100, 100, 0), Map.Felucca) // X, Y, and Z location as well as the map you want to teleport to.
this.Delete(); // After you've been moved to the world, delete the item. The this. just means the current item the script is on. It is redundant to say this.Delete(), since your already in the scripted item you want to delete, but its good practice to do it while your learning. You can very well just say Delete();
}
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.