用户:
BlackShadow查看:1 回复:3 评论:1 创建时间:2023-04-10T18:50:24
world.onChat(async({ entity, message }) => {
if (message === '/tp') }
const gethc = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: "请选择传送的地方",
title:"传送系统",
options: ["出生岛","家园","资源"],
})
if(!gethc)return;
if(gethc.index==0){
entity.position.set(1,1,1)
}
if(gethc.index==1){
entity.player.dialog({
type: Box3DialogType.TEXT,
content: "请稍后",
title:"家园",
})
}
if(gethc.index==2){
entity.player.dialog({
type: Box3DialogType.TEXT,
content: "资源区正在加载中",
title:"资源1区",
})
}
如题
HIM_PETERworld.onChat(async({ entity, message }) => {
if (message === '/tp') {
const gethc = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: "请选择传送的地方",
title:"传送系统",
options: ["出生岛","家园","资源"],
})
if(!gethc)return;
if(gethc.index==0){
entity.position.set(1,1,1)
}
if(gethc.index==1){
entity.player.dialog({
type: Box3DialogType.TEXT,
content: "请稍后",
title:"家园",
})
}
if(gethc.index==2){
entity.player.dialog({
type: Box3DialogType.TEXT,
content: "资源区正在加载中",
title:"资源1区",
})
}
}
})点赞1
评论
边城过客这个简单,这段代码缺少一个左大括号 {,应该改为:
world.onChat(async ({ entity, message }) => {
if (message === '/tp') {
const gethc = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: "请选择传送的地方",
title: "传送系统",
options: ["出生岛", "家园", "资源"],
})
if (!gethc) return;
if (gethc.index == 0) {
entity.position.set(1, 1, 1)
}
if (gethc.index == 1) {
entity.player.dialog({
type: Box3DialogType.TEXT,
content: "请稍后",
title: "家园",
})
}
if (gethc.index == 2) {
entity.player.dialog({
type: Box3DialogType.TEXT,
content: "资源区正在加载中",
title: "资源1区",
})
}
}
})
点赞1
评论