Paste #16278: Edit of P#16277 - Untitled Paste

Date: 2015/06/04 19:59:30 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21


CallHorse:
    type: command
    name: callhorse
    usage: /callhorse
    description: Calls your horse to you!
    # allowed help:
        # - determine <context.server.not>
    script:
        - if <player.has_flag[haveHorse]> && <player.flag[havehorse].as_entity.is_leashed> {
            - narrate format:ServerChat "Your horse is leashed and cannot be called!"
            - log "<player.name> tried to call a leashed horse!" file:plugins/Denizen/logs/stablemaster.log
        }
        else if <player.has_flag[haveHorse]> {
            - narrate format:ServerChat "Your horse has been teleported to your location!"
            - teleport <player.flag[haveHorse].as_npc> <player.location>
            - log "<player.name> called their horse." file:plugins/Denizen/logs/stablemaster.log
        }
        else {
            - narrate format:ServerChat "You do not have a horse!" targets:<player>
            - log "<player.name> attempted to call their horse but they do not have one." file:plugins/Denizen/logs/stablemaster.log
        }