
Lv.1
(((
签名:退岛了
在 【神岛代码教程】 如何做私信代码 中回复
太水了别喷()
global.select = async function(entity,title,content,options){
return entity.player.dialog({
type:Box3DialogType.SELECT,
title:title,
content:content,
options:options,
});
};
global.input = async function(entity,title,content,confirmText){
return entity.player.dialog({
type:Box3DialogType.INPUT,
title:title,
content:content,
confirmText:confirmText,
});
};
world.onPlayerJoin(async ({ entity }) => {
entity.enableInteract = true;
entity.interactRadius = 3;
});
world.onInteract(async({entity,targetEntity})=>{
if(entity.isPlayer){
const r = await select(entity,targetEntity.player.name+'的个人信息',`操作:`,['私聊'],);
if(r){
if(r.value == '私聊'){
let sending = null;
let receive = null;
while(true){
sending = await input(entity,targetEntity.player.name,receive,'发送');
if(sending == null){
break;
};
receive = await input(targetEntity,entity.player.name,sending,'发送');
if(receive == null){
break;
};
};
};
};
};
});2022-12-22T12:48:24 点赞:0