
Lv.1
随时*尸你信不信
签名:👍点赞分:860/1000 收藏分:1000/1000 再创作分:1000/1000 朋友:灭剑、BKS清北蓉远的神、风吹清雪、是摸鱼的元宵鸭 师傅:日日临池把墨研 2022年9月20日第一个首页 2022年9月23日上了高手 2023年7月31日上了大佬 (上线时间不多) 1新喵
在 神奇代码岛用户手册上线,从0开始了解神岛 中回复
console.clear(); // 清空控制台
world.onPlayerJoin(({ entity }) => { // 当实体进入地图
if (entity.isPlayer) { // 如果实体是一个玩家
entity.addTag('NotInGame'); // 添加标签 “不在游戏中”
if (world.querySelectorAll('player').length >= 3) { // 如果玩家的数量 >= 3 则开始游戏
for (const c of world.querySelectorAll('.NotInGame')) { // 让所有不在游戏中的玩家传送到 “游戏区”
c.player.spawnPoint.set(60, 15, 76); // 重新重生点
c.player.forceRespawn(); // 强制传送
c.removeTag('NotInGame'); // 删掉标签 “不在游戏中”
c.player.dialog({ // 对话框
type: Box3DialogType.TEXT,
title: `欢迎`,
content: `人数已超过 3 人,可进入游戏~~`
})
}
}
else { // 如果玩家人数不够,就执行这些代码
entity.player.spawnPoint.set(41, 37, 44); // 在上层 “休息区” 出生
entity.player.forceRespawn(); // 强制传送(重生)
entity.player.dialog({ // 发送对话框
type: Box3DialogType.TEXT,
title: `欢迎`,
content: `目前人数未达到 3 人,请等待其他玩家进入~~`
})
}
}
});2022-07-09T21:37:24 点赞:1
在 啊啊啊,烦喵啦!!! 中回复
https://kitten4.codemao.cn/?invite_code=uXgsK67n我在编程猫发起了一个协作项目,点击链接即可加入一起创作!
2022-07-29T11:14:38 点赞:0
在 为什么社区最近老是这样? 中回复
imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E7%82%B9%E8%B5%9E.gif"alt="emotion_编程猫_点赞"
2022-07-31T09:21:20 点赞:0