猫史档案馆


box3在游玩端聊天框输入“踢出+人名”就能踢人的代码

用户:Cherry_妍晞Cherry_妍晞查看:11 回复:11 评论:11 创建时间:2022-11-13T10:42:56


center_image

在游玩端的聊天框输入“踢出+人名”就可以把这个人踢出的管喵权限怎么搞?代码是要写在脚本,不是控制台的而且最好踢出后5分钟内进不来。如果不会,那在游玩端直接在聊天框输代码的踢人方式也教一下~


回复

上一页1 页 / 共 1下一页
145a145a

用onChat啊,踢人用kick

点赞0


评论


Cherry_妍晞Cherry_妍晞

不是,具体的代码(整个)怎么搞?

点赞0


评论


名探酱名探酱

var zuozhe = ['']//这里填入玩家名字

 world.onChat(async ({ entity, message }) => {
    if (zuozhe.includes(entity.player.name)) {
        if (message[0] == "$") {
            if (zuozhe.includes(entity.player.name)) {
                try {
                    var code = eval(message.slice(1));
                    world.say(`~>${code}`)
                }
                catch (e) {
                    world.say(e)
                }
            }
        }
    }
})
//在聊天框输入$ + 你要执行的代码

点赞0


评论


名探酱名探酱

world.onChat(async ({ entity, message }) => {
    if (entity.isPlayer) {
        if (zuozhe.includes(entity.player.name)) {
if (message.startsWith('/KICK/')) {
                if (message.slice(6) == entity.player.name) {
                    entity.player.directMessage('无法干掉自己,请重新尝试!')
                } else {
                    world.querySelectorAll('player').forEach((x) => {
                        if (x.player.name == message.slice(6)) {
                            world.say('有人被踢走了!')
                            x.player.kick()
                            world.say('管喵踢走了' + x.player.name)
                        }
                    })
                }
            }
}
}
})

点赞0


评论


yee剑走天下yee剑走天下

如果是萌新,我可能会给,噢,一看是USS小团体,瞬间不想理了

点赞3


评论


算了还是给你代码把

const guanli = ['不知道取啥名的屑']//管理名称
world.onChat(({ entity,message }) => {
    if(guanli.includes(entity.player.name) && message.includes(`踢出 ${entity.player.name}`)) {
        entity.player.kick()//写名字时记得在“踢出”后面空格
        world.say(`已踢出${entity.player.name}`)
    }
})

点赞0


评论


叁式橙子叁式橙子

const ZZ = [',]//

 

world.onChat(({ entity, message }) => {     if (message.startsWith('踢出') && ZZ.includes(entity.player.name)) {         world.querySelectorAll('player').forEach((x) => {             if (x.player.name == message.slice(2)) {                 if (ZZ.includes(x.player.name)) {                     entity.player.directMessage(`管喵不可被踢出!!!`)                 } if (ZZ.includes(x.player.name)) return;                 world.say(`${x.player.name} 管喵 ${entity.player.name} 踢出了基地!!`)                 x.player.kick()             }         })     } else if ((message) == '清服') {         world.say('已清服')         world.querySelectorAll('player').forEach((x) => {             if (ZZ.includes(x.player.name)) return;             x.player.kick()         })     } })

您好,我是DF在线写代码的学神这是您要的代码//注释在中括号了用引号添加人名即可

点赞0


评论


snovsnov

漫游者:()()()

点赞0


评论


Cherry_妍晞Cherry_妍晞

那如果再来一个10分钟内无法再次进入呢?

对代码师的考验~

点赞0


评论


SHEL深空无尽SHEL深空无尽

world.querySelectorAll('player').forEach((e) => if(e.player.name == '写上你的名字'){e.player.kick()})

点赞0


评论


扫厕所地方军阀111扫厕所地方军阀111

收藏一下,价值大大的高

点赞0


评论