用户:
fjskdfjslkd查看:8 回复:6 评论:8 创建时间:2023-03-02T19:00:56
console.clear();
world.onPlayerJoin(({ entity }) => {
if (entity.isPlayer) {
entity.addTag('NotInGame');
if (world.querySelectorAll('Player').length >= 3) {
c.player.spawnPoint.set(239,24,232);
c.player.forceRespawn();
c.removeTag('NotInGame')
c.player.dialog({
type:Box3DialogType,
title:`欢迎进入游戏`,
content:(`目前人数已经超过三人,开始游戏吧`)
})
}
}
else {
entity.player.spawnPoint.set(119,2,129);
entity.player.forceRespawn();
entity.player.dialog({
type: Box3DialogType.TEXT,
title: '欢迎',
content: `在线人数未满3人,无法加入游戏,快来邀请小伙伴来玩`
})
}
});
这是吉吉喵的第三期代码教程师【神岛】第三期代码教程师——“三人成虎”开局条件教程_网络游戏热门视频 (bilibili.com)
由于吉吉没有发布代码,所以,自己照吉吉抄的
然后,运行后没有报错,但是,无效果
fjskdfjslkdconsole.clear(); world.onPlayerJoin(({ entity }) => { if (entity.isPlayer) { entity.addTag('NotInGame'); if (world.querySelectorAll('Player').length >= 3) { entity.player.spawnPoint.set(239,24,232); entity.player.forceRespawn(); entity.removeTag('NotInGame') entity.player.dialog({ type:Box3DialogType, title:`欢迎进入游戏`, content:(`目前人数已经超过三人,开始游戏吧`) }) } } else { entity.player.spawnPoint.set(179,44,77); entity.player.forceRespawn(); entity.player.dialog({ type: Box3DialogType.TEXT, title: '欢迎', content: `在线人数未满3人,无法加入游戏,快来邀请小伙伴来玩` }) } });
点赞0
评论