Date: 2017/05/11 22:40:00 UTC-07:00
Type: Denizen Script
use_login_logout_handler:
type: world
debug: true
events:
on player joins:
- if !<player.has_flag[erpg_region]> {
- queue clear
}
- if !<yaml.list.contains[lt_<player>]> {
- yaml "load:/loot/playerdata/<player>.yml" id:lt_<player>
}
- inventory clear
- inventory set d:<player.inventory> o:<yaml[lt_<player>].read[inv.inv]>
- if !<server.flag[lt_savecycle].contains[<player>]||false> {
- flag server "lt_savecycle:->:<player>"
}
- teleport <player> <yaml[lt_<player>].read[tp.loc]||<player.location>>
- foreach <pl.flag[join_channel]||li@> {
- inject locally <def[value]>
}
on player quit:
- if !<player.has_flag[erpg_region]> {
- queue clear
}
- yaml id:lt_<player> set inv.inv:!
- yaml id:lt_<player> set "inv.inv:|:<player.inventory.list_contents>"
- yaml id:lt_<player> set "tp.loc:<player.location>"
- flag player last_login:<server.current_time_millis>
- foreach <pl.flag[quit_channel]||li@> {
- inject locally <def[value]>
}