Player Ping Command v1
2019/11/03 15:47:21 UTC-08:00
Click here to view this paste as a raw text file | Or download the script
### Player Ping Command
# by Mwthorn (Discord: Mwthorn#2843) (Mail: email@example.com)
# Ask for help at any time on the Official Denizen Script Discord: https://discord.gg/Q6pZGSR
# Displays a player's current ping. This is mainly just an example on how to make a command with Denizen.
# It has the following commands included:
# /ping - Check your own ping
# /ping (player) - Checks another player's ping
# - Place the script in your script folder.
# - Restart server or reload scripts
# - Done! Now you can use /ping (player)
description: "Checks a player's ping from Denizen"
usage: "/ping (player)"
- if <context.args.size> > 0:
- define target:<server.match_player[<context.args.get>]||null>
- if <[target]> == null:
- narrate "<&7><context.args.get> is not online."
- if <context.server>:
- define target:<player>
- define ping:<[target].ping||null>
- if <def[ping]> == null:
# Very rare case, but can happen.
- narrate "<&e><[target].name>s' ping was not found"
- narrate "<&e><[target].name>'s ping is <&a><[ping]>"