猫史档案馆


【box3代码问题】谁有反挂机的代码

用户:一个STUB用户_14302596一个STUB用户_14302596查看:15 回复:18 评论:15 创建时间:2022-01-22T19:08:28


如题,要求,当挂机超过……秒,自动进入幽灵模式


回复

上一页1 页 / 共 1下一页
一个STUB用户_14302596一个STUB用户_14302596

ddddddd

点赞0


评论


一个STUB用户_14302596一个STUB用户_14302596

aaaaaa

点赞0


评论


一个STUB用户_14302596一个STUB用户_14302596

差不多得了😅

点赞0


评论


一个STUB用户_14302596一个STUB用户_14302596

差不多得了😅

点赞0


评论


一个STUB用户_14302596一个STUB用户_14302596

差不多得了😅

点赞0


评论


一个STUB用户_14302596一个STUB用户_14302596

差不多得了😅

点赞0


评论


一个STUB用户_14302596一个STUB用户_14302596

差不多得了😅

点赞0


评论


Architect_皮卡awaArchitect_皮卡awa

emotion_doge

点赞1


评论


你好2050_反防沉迷_反岛三出图形化你好2050_反防沉迷_反岛三出图形化

这是要检测你是否一直在一个位置上没移动

点赞1


评论


蓝矮爱乐蓝矮爱乐

玩家挂机60秒,进入幽灵

var Detect_hang_up = 0
var time = 0
world.onPlayerJoin(({entity})=>{
    entity.Detect_hang_up = entity.position
    entity.time = 60
})
world.onTick(({entity})=>{
    if(Detect_hang_up !== entity.position){
        entity.Detect_hang_up = entity.position
        entity.time = 60
    }
})
world.onPlayerJoin(async({entity})=>{
    while(entity.time <= 0){
        entity.time -= 1
        await sleep(1000)
    }
    if(entity.time <= 0){
        entity.player.spectator = true
    }
})

(不敢加注释,怕排版被吞)这个反挂机的代码没测试过,不知道好不好用

这是挂机超过60秒自动进入幽灵的

点赞0


评论


一个STUB用户_14302596一个STUB用户_14302596

center_image

点赞0


评论


张允旭张允旭

来我测试地图~?

点赞1


评论


张允旭张允旭

console.clear()
world.onPlayerJoin(({ entity }) => {
    entity.gj = false
    world.onTick((tick) => {
        if (entity.player.walkState == Box喵layerWalkState.NONE) {
            if (entity.gj == false) {
                entity.gjtick = tick.tick;//纪录开始挂机的tick
            }
            entity.gj = true//将挂机状态改为true
            world.addCollisionFilter(entity,'player');
            if (Math.abs(entity.gjtick - tick.tick) >= 156) {//一tick是喵毫秒,因此10秒就是156.25,四舍五入156tick
                entity.player.spectator=true
            }
        } else { //如果不想移动后自动取消挂机,去掉else部分
            world.removeCollisionFilter(entity,'player');
            entity.gj = false//将挂机状态改为false
            entity.player.spectator=false
        }
    })
})

 

点赞1


评论


蓝矮爱乐蓝矮爱乐

var Detect_hang_up = 0
var time = 0
world.onPlayerJoin(({entity})=>{
    entity.Detect_hang_up = entity.position
    entity.time = 3
})
world.onPlayerJoin(({entity})=>{
    world.onTick(()=>{
        if(entity.Detect_hang_up !== entity.position){
            entity.Detect_hang_up = entity.position
            entity.time = 3
        }
    })
})
world.onPlayerJoin(async({entity})=>{
    while(entity.time >= 0){
        entity.time -= 1
        await sleep(1000)
    }
    if(entity.time <= 0){
        entity.player.spectator = true
    }
})

点赞1


评论


DebugDynamoDebugDynamo

world.onPlayerJoin(({ entity }) => {
    entity.guaji = 0
    world.onTick(() => {
        if (entity.player.walkState == Box喵layerWalkState.NONE) {//如果玩家没运动
            entity.guaji += 1
        } else {
            entity.guaji = 0
        }

        if (entity.guaji == 60 * 16 * 5) {// 1000/64表示1秒内有16个tick(估算),60表示判定秒数
            entity.player.dialog({
                type: Box3DialogType.TEXT,
                content: '你已挂机5分钟,请重进游戏!',
                title: '系统'
            })
            entity.player.kick()
            //挂机室的坐标(如果是传送到地面一定要记得把y轴数据加3!)

            //此外也可以改成玩家进入幽灵状态等等
        }
        //大家最好在弹出对话框设置挂机数为0,免得玩家在对话框停留60秒造成‘挂机’
    })
})

点赞0


评论


屑羽yee屑羽yee

挖()

点赞1


评论


千星河凉月吖千星河凉月吖

aa

 

点赞0


评论


屑怪盗屑怪盗

挖!

点赞0


评论