Welcome to PenUltima Online. Click to login or register.

Functions:

Detach()
Explanation
Disassociates the current script from the character that it is attached to. See Attach() too.
If the current script is not attached to a character, does nothing.
Example: a spell script for both doing the spell, implementing a temporary spell effect on an object, and removing the effect after an amount of time:
Program Spell(who)
    // Test, if spell possible (reagents, mana, line of sight, etc..)
    // Do the spell, animations, etc.
    // Now something is changed, a temporary effect is installed to an
object, this effect will expire in n seconds
    // Detach the script from the caster
    Detach(); //this allows other scripts to run on this character during the below sleep()
    sleep(n); //delay until effect time is elapsed
    // End the effect, and return
endprogram
Return values
1 on success (the script was attached to a character, and is no longer.)
Errors
none (returns 0 on failure (character invalid))
Related
Character