用户:wwwNICHENG查看:16 回复:10 评论:16 创建时间:2020-08-30T20:16:51
要一个代码岛的师傅
,主要是会代码
world.onPlayerJoin(({entity})=>{//出生点代码
entity.position.set(104, 72, 77);
});
接下来。。。
world.onPlayerJoin(({ entity }) =>{//当开始被打击就出现的文本框代码
const dialog = entity.player.dialog({
type: Box3DialogType.TEXT,
title: "寒江的雪(作者)",
content: `你好,${entity.player.name},这里是撕名牌候场区。`,//我。。。好像泄露了什么???
});
});
点赞0
评论
world.onChat(async({ entity, message }) => {//聊天区互动代码~~~
if (entity && entity.isPlayer) {
str = message;//设置str的值为玩家聊天信息
if(str=='简介'){//if是如果的意思
entity.player.directMessage('系统客服:本地图属于竞赛类地图')//entity.player.directMessage是私信功能
await sleep(1000)//时间等待代码,经计算,1000大约是1S
entity.player.directMessage('【特别鸣谢】')
await sleep(1000)
entity.player.directMessage('地图拥有者:寒江的雪')
await sleep(1000)
entity.player.directMessage('地图作者:寒江的雪')
await sleep(1000)
await sleep(1000)
entity.player.directMessage('创作团队:WIS_汤圆酱Gh千惜、UUS viki617、BJT 渐淡的萌萌熊、地方晴 天间客、CM一天中午')
await sleep(1000)
entity.player.directMessage('感谢以上大佬参与!祝你玩得开心(*^▽^*)')
await sleep(1000)
}else if(str=='开始游戏'){//else是否则的意思
entity.position = new Box3Vector3(115,50,15);//传送代码,可选择删除
world.say(entity.player.name+'开始游戏了')//world.say是公告功能
}else if(str=='说明平台'){
entity.position = new Box3Vector3(115,70,15);
entity.player.directMessage('去碰那个机器人')
}else if(str=='退出'){
entity.position = new Box3Vector3(115,50,15);
}}}
)
互动干货在这里
点赞0
评论
world.onPlayerJoin(({ entity }) => {//玩家进入时//粒子特效干货~~~
if (entity.player.name==="寒江的雪"||entity.player.name==="WIS_汤圆酱Gh千惜"||entity.player.name==="CM一天中午"||entity.player.name==="开心小喵呜"){//玩家设定(指定玩家)可删除
Object.assign(entity, {
particleRate: 400,//粒子数量,可更改,越大粒子越多
particleSize: [1, 2, 4, 3, 4],//粒子在每个阶段的大小,可更改
particleColor: [//例子在每个阶段的颜色,可更改
new Box3RGBColor(0,1,1),//第一阶段
new Box3RGBColor(0.3, 0.1, 1),//第二阶段
new Box3RGBColor(0., 0.05, 0.02),//第三阶段
new Box3RGBColor(0.3, 0.1, 1),//第四阶段
new Box3RGBColor(0., 0.05, 0.02),//第五阶段
],
particleLifetime: 0.2,//粒子存活时间,单位:秒,可更改,越大存活时间越长
particleVelocitySpread: new Box3Vector3(1, 1 ,1),//粒子随机飘散,可更改
});//你懂的
}//你懂的
})//你懂的
粒子特效干货~~~
点赞0
评论