owobot/plugins/commands/tpr.js
2024-07-29 18:11:03 -04:00

44 lines
1.1 KiB
JavaScript
Executable file

module.exports = {
execute: function (c) {
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,
z: Math.floor(Math.random() * 2000000) - 1000000
}
c.reply(
{
translate: 'Teleporting %s to %s, %s, %s',
color: c.colors.secondary,
with: [
{
text: c.username,
color: c.colors.primary
},
{
text: original_pos.x.toString(),
color: c.colors.primary
},
{
text: original_pos.y.toString(),
color: c.colors.primary
},
{
text: original_pos.z.toString(),
color: c.colors.primary
}
]
}
)
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']
}