用户:
Ninesir查看:0 回复:0 评论:0 创建时间:2022-04-09T23:56:08
//欢迎玩家
const map_name = ('地图名称')
world.onPlayerJoin(({ entity }) => {
entity.player.forceRespawn();
entity.player.juice = 0;
entity.player.directMessage(`欢迎@${entity.player
.name},来到${map_name}\n`);
})
//有人不听话?
if (message.startsWith('禁言')) {
if (message.slice(2) == entity.player.name) {
entity.player.directMessage('无法禁言自己,请重新尝试!')
} else {
world.querySelectorAll('player').forEach((x) => {
if (x.player.name == message.slice(2)) {
x.player.directMessage('你已被管喵禁言,请等待管喵解除')
world.say('有人犯了错,被管喵禁言了!')
x.player.muted = true
}
})
}
}
if (message.startsWith('解除禁言')) {
if (message.slice(4) == entity.player.name) {
entity.player.directMessage('无法解除禁言自己,请重新尝试!')
} else {
world.querySelectorAll('player').forEach((x) => {
if (x.player.name == message.slice(4)) {
x.player.directMessage('你已被管喵解除禁言')
world.say('有人已被管喵解除禁言了!')
x.player.muted = false
}
})
}
}
}
}
});
//管喵权限
var canfly = ['玩家id',]
world.onPlayerJoin(({ entity }) => {
if (canfly.includes(entity.player.name)){
Object.assign(entity, {
particleRate: 200,
particleSize: [1,2, 3, 4, 5],
particleColor: [
new Box3RGBColor(10, 0, 0),
new Box3RGBColor(0, 10, 0),
new Box3RGBColor(0, 0, 10),
],
particleLifetime: 1,
particleVelocitySpread: new Box3Vector3(0, 0, 0),
});
entity.player.canFly = true;
}
});