Paste #32280: Untitled Paste

Date: 2016/04/04 13:09:21 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


initiate_instance:
  type: task
  debug: false
  speed: 0
  script:
  - define blueprint <def[blueprint]||<def[1]||none>>
  - if <server.has_file[../../instancing/blueprints/<def[blueprint]>].not> {
    - announce to_ops "uh oh! Tried to load an instance from an inexisting blueprint!"
    - queue clear
    }
  - define player <def[player]||<def[2]||none>>
  - if <def[player].is_player.not||false> {
    - announce to_ops "Uh oh! No player specified to create an instance for!"
    - queue clear
    }
  - if <server.has_file[../../instancing/instances/<def[player].uuid>]> {
    - inject remove_instance
    }
  - if <server.list_worlds.contains[w@instancing/blueprints/<def[blueprint]>].not> {
    - createworld instancing/blueprints/<def[blueprint]>
    }
  - createworld instancing/instances/<def[player].uuid> copy_from:instancing/blueprints/<def[blueprint]>