Paste #41809: Daily Login Script

Date: 2017/05/13 08:02:12 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


TestScript:
    type: world
    events:
        on player joins:
        - wait 1
        - if <player.has_flag[cooldown_DailyBonus]> {
            - narrate "You will recieve a bonus in <player.flag[cooldown_DailyBonus].expiration.formatted> when you login to the server again."
            - queue clear
        }
        - if <player.inventory.empty_slots> > 0 {
            - narrate "Welcome back! You recieved a bonus of 5 Emerals and $10 as a daily login bonus!"
            - give Emerald qty:5
            - execute as_server "eco give <player.name> 10"
            - flag player cooldown_DailyBonus duration:24h
            if <player.has_flag[returnForitems]> {
                - flag player returnForItems:!
            }
            - queue clear
        } else {
            - narrate "You don't have an empty inventory slot. Please empty 1 slot and re-login again to recieve your bonus!"
            - flag player returnForItems  
            - queue clear
        }