用户:
YDS尹子查看:1624 回复:44 评论:31 创建时间:2020-08-09T17:13:39

//nc=n c
world.querySelectorAll(".findAdmin").forEach((finder) => {
finder.enableInteract = true;
finder.interactRadius = 8;
finder.interactHint = "玩家查找器";
finder.interactColor = new Box3RGBColor(1, 1, 1);
finder.onInteract(async ({ entity }) => {
const result = await entity.player.dialog({
title: '系统',
type: Box3DialogType.INPUT,
content: `全局玩家查询系统开启,你要查询哪个玩家?`,
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
placeholder: '请输入玩家名',
confirmText: '确认',
})
const findee = world.querySelector("." + result);
const resu=await entity.player.dialog({
title: '系统',
type: Box3DialogType.SELECT,
content: `找到玩家${findee.player.name}`,
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
lookEye: entity,
lookEyeOffset: new Box3Vector3(0, 30, 0),
lookTarget: findee,
options:["到他那里去","知道了"],
})
if(resu.index==0){
entity.position.set(findee.position.x,findee.position.y+2,findee.position.z)
}
findee.player.dialog({
title: '系统',
type: Box3DialogType.TEXT,
content: `你被${entity.player.name}查询了`,
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
})
})
})
YDS尹子先添加一个模型并加上标签findAdmin
点赞1
评论
给我搞上?谢谢!万分感谢!https://box3create.codemao.cn/games/cc喵cf2265bf3f0e4466
https://box3create.codemao.cn/games/cc喵cf2265bf3f0e4466
好了
感谢
YDS尹子还有一段代码要添上
world.onPlayerJoin(({entity})=>{entity.a喵Tag(entity.player.name)})点赞0
评论
sofa
加在哪???????能不能发个完整的?
添哪?
添哪?
添哪?
加开头
怎么用
world.onPlayerJoin(({entity})=>{entity.addTag(entity.player.name)})
world.querySelectorAll(".玩家查找器").forEach((finder) => {
finder.enableInteract = true;
finder.interactRadius = 8;
finder.interactHint = "玩家查找器";
finder.interactColor = new Box3RGBColor(1, 1, 1);
finder.onInteract(async ({ entity }) => {
const result = await entity.player.dialog({
title: '系统',
type: Box3DialogType.INPUT,
content: `全局玩家查询系统开启,你要查询哪个玩家?`,
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
placeholder: '请输入玩家名',
confirmText: '确认',
})
const findee = world.querySelector("." + result);
try {
if (findee.isPlayer) {
const resu=await entity.player.dialog({
title: '系统',
type: Box3DialogType.SELECT,
content: `找到玩家${findee.player.name}`,
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
lookEye: entity,
lookEyeOffset: new Box3Vector3(0, 30, 0),
lookTarget: findee,
options:["到他那里去","知道了"],
})
if(resu.index==0){
entity.position.set(findee.position.x,findee.position.y+2,findee.position.z)
}
findee.player.dialog({
title: '系统',
type: Box3DialogType.TEXT,
content: `你被${entity.player.name}查询了`,
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
})
}
} catch(err) {
await entity.player.dialog({
type:Box3DialogType.TEXT,
title:'找不到这个玩家!',
content:'无法查找此玩家'
})
}
})
})
改版代码,不会出错
点赞0
评论
没缩进。
挑刺有意思吗
本来就很明显,我的代码经验也不算多
缩进不是问题好嘛程序照样运行,又不是python
搞不懂你到底是强迫症呢还是喜欢凑行数的人呢
怎么用