Make tpr work at console
This commit is contained in:
parent
6e97bae39e
commit
4cdc4f22fe
1 changed files with 8 additions and 2 deletions
|
@ -1,6 +1,11 @@
|
|||
module.exports = {
|
||||
execute: function (c) {
|
||||
if(c.type == console) return; //this can not run at console
|
||||
let uuid;
|
||||
if(c.type == "console"){
|
||||
uuid = c.bot._client.uuid;
|
||||
} else {
|
||||
uuid = c.uuid;
|
||||
}
|
||||
const original_pos = {
|
||||
x: Math.floor(Math.random() * 2000000) - 1000000,
|
||||
y: 100,
|
||||
|
@ -30,9 +35,10 @@ module.exports = {
|
|||
]
|
||||
}
|
||||
)
|
||||
c.bot.ccq.push(`/essentials:tp ${c.uuid} ${original_pos.x}.0 ${original_pos.y} ${original_pos.z}.0`)
|
||||
c.bot.ccq.push(`/essentials:tp ${uuid} ${original_pos.x}.0 ${original_pos.y} ${original_pos.z}.0`)
|
||||
},
|
||||
desc: 'Teleport to a random location',
|
||||
usage: ' [-s]',
|
||||
consoleIndex: true,
|
||||
aliases: ['rtp']
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue