Date: 2023/08/11 08:05:18 UTC-07:00
Type: Denizen Script
carrier_bird:
type: command
name: m
description: Sends a carrier bird message to another player!
usage: /m player|message
permission: dscript.m
script:
# Lets sender know they need to include all the arguments
- if <context.args.size> < 2:
- narrate "<red>/m [player] [message]"
- stop
# Let sender know if recipient doesn't exist
- define sender <player.display_name>
- define target <server.match_player[<context.args.get[1]>].if_null[null].display_name>
# If incorrect name, tell user and stop
- if <[target]> == null:
- narrate "<yellow><context.args.get[1]><red> can not be found. Make sure you write the name correctly."
- stop
# Defining the message argument (2)
- define message <context.args.remove[1].space_separated>
# Only send a letter if sender has a piece of paper
- if !<[sender].inventory.contains_item[paper]> >= 1:
- narrate "<red>woah chill!"
- stop
# Lets the sender know they've sent the letter
- if <[sender]>:
- narrate "<yellow>[Carrier bird sent to <[target]>]"
# Receiving the message as a receipent
- narrate "<yellow>[Carrier bird from <[sender]>] <white><[message]>" (targets:<[target]>...) (from:<[sender]>)