'Add a script to this object.
Args:
scriptclass (Scriptclass, Script or str): Either a class
object inheriting from DefaultScript, an instantiated
script object or a python path to such a class object.
key (str, optional): Identifier for the script (often set
in script definition and listings)
autostart (bool, optional): Start the script upon adding it.'

def add(self, scriptclass, key=None, autostart=True):

    if (self.obj.__dbclass__.__name__ == 'PlayerDB'):
        script = create.create_script(scriptclass, key=key, player=self.obj, autostart=autostart)
    else:
        script = create.create_script(scriptclass, key=key, obj=self.obj, autostart=autostart)
    if (not script):
        logger.log_err(('Script    %s    could    not    be    created    and/or    started.' % scriptclass))
        return False
    return True
