public override void Drink( Mobile from )
{
var locker = typeof( BaseExplosionPotion );
if ( !from.BeginAction( locker ) )
{
from.SendMessage( "You must wait a moment before using another purple potion." );
return;
}
Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), from.EndAction, locker ); // end the lock in 5s
// rest of the existing code ->
Ah works great thank you so muchYou can do this by using a timer delay and the action lock functions, something like this should do the trick;
BaseExplosionPotion.cs
Code:public override void Drink( Mobile from ) { var locker = typeof( BaseExplosionPotion ); if ( !from.BeginAction( locker ) ) { from.SendMessage( "You must wait a moment before using another purple potion." ); return; } Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), from.EndAction, locker ); // end the lock in 5s // rest of the existing code ->
We use essential cookies to make this site work, and optional cookies to enhance your experience.