
Lv.1
签名:一枚被封藏在历史中的屑?
在 【岛3老活新整创作节】官方地图《赤碧城》限时送,报名时间已截止! 中回复
我要报名参赛,地图编辑地址是https://box3.codemao.cn/e/342a96d5af6f7e6f48eb
2021-04-23T20:53:47 点赞:0
在 【box3】检测挂机代码 中回复
varguaji=[] //会将检测到的挂机玩家的识别码加入此列表,当挂机玩家重新进入游戏时删除他的识别码world.onPlayerJoin(({entity})=>{entity.player.jilu=0entity.player.jilu2= 0//一些玩家的私有变量 }) world.onTick(({})=>{world.querySelectorAll('player').forEach(async(e)=>{if(!guaji.includes(e.player.userKey)){ //如果已经提示过玩家就不再提示了。e.player.jilu=e.positionif(e.player.jilu==e.position){ //检测玩家位置是否变化 e.player.jilu2+=1if(e.player.jilu2>=300){ //检测玩家是否长时间位置不变化,是则判定挂机。可以改变数值以改变判定挂机的秒数,此代码默认300Tick。 e.player.invisible=true//也可以根据游戏内容改为其他事件e.player.spectator=truee.player.directMessage('系统检测到你在挂机,自动退出游戏。') e.player.directMessage('若想重新加入游戏,请说“加入游戏”')//提示玩家guaji.push(e.player.userKey)} }else{e.player.jilu2=0 //玩家进行移动,重新开始计算是否挂机}}})})world.onChat(({entity,message})=>{entity.player.jilu2=0//防止有些玩家因为打字而不移动位置if(message=='加入游戏'){//挂机玩家重新进入游戏if(guaji.includes(entity.player.userKey)){guaji.splice(guaji.indexOf(entity.player.userKey))entity.player.directMessage('已加入游戏')entity.player.invisible=false//取消之前对玩家的改变entity.player.spectator=false}else{entity.player.directMessage('你不在挂机!')//防止玩家不在挂机时输入此内容}}})
2021-04-24T17:41:59 点赞:0
在 【每日一个岛3建图小技巧】有喜事了?放个烟花庆祝下! 中回复
async function Fire() {//这是我的
const random1 = Math.random(), random2 = Math.random(), random3 = Math.random(), random4 = Math.random()
const fire = world.createEntity({
gravity: false,
collides: false,
position: new Box3Vector3(Math.random() * 128, 128, Math.random() * 128),
particleSize: [8, 6, 4, 2],
particleRate: 1,
particleLifetime: 0.07,
particleVelocity: new Box3Vector3(0, 0, 0),
particleVelocitySpread: new Box3Vector3(45, 45, 45),
particleDamping: -1,
particleRateSpread: 500,
particleColor: new Box3RGBColor(random1 * 40, random2 * 2, random3 * 2)
})
fire.particleRate = 0
for (let x = 0; x < 128; x++) {
await sleep(20)
fire.position.y++
}
await sleep(2560)
fire.a喵Tag('fire')
fire.particleRate = 1200
fire.particleLifetime = 1
if (random4 < 0.33) {
fire.particleColor = new Box3RGBColor(random1 * 40, random2 * 2, random3 * 2)//red
} else if (random4 < 0.66) {
fire.particleColor = new Box3RGBColor(random1 * 2, random2 * 30, random3 * 2)//green
} else {
fire.particleColor = new Box3RGBColor(random1 * 2, random2 * 2, random3 * 40)//blue
}
await sleep(5000)
world.querySelectorAll('.fire').forEach((e) => { if (!e.isPlayer) { e.destroy() } })
}2021-04-26T19:17:54 点赞:0
在 【岛3漫游指南】:你是怎样,岛3就是怎样! 中回复
1、地图无限大
2、如果发XX家族招人被举报会被封(主要是没啥用)
3、不规则模型不要是正方体/长方体了(可以选择)
4、增加汉字方块(一个方块放值上去会自动弹出输入汉字,输入完后会自动显示这个汉字)
2021-04-28T19:58:53 点赞:2
在 sql教程 中回复
清除表格所有数据 (表格结构不变)
async function remove() {
await db.sql`delete 表名称`
}
remove()
删除表
db.sql`drop table 表名称`
(有个位置没发好)
2021-04-30T14:19:25 点赞:0
在 【岛3老活新整创作节】赤壁对战 中回复
人员变化:LOGIC.py(代码)https://box3.codemao.cn/u/millow
我(全部)https://box3.codemao.cn/u/3361539
2021-05-04T13:51:00 点赞:0
在 谁知道密码们怎么做 中回复
world.querySelectorAll('#模型名').forEach((entity) => {
entity.enableInteract = true
entity.interactHint = '名称'
entity.interactRadius = 5//5是范围
entity.onInteract(({ entity }) => {
var key = await entity.player.dialog({
type: Box3DialogType.INPUT,
title: '密码机',//当然也可以是别的
content: '请输入密码',
placeholder: '输入密码...'
})
if (key == null) return
var value = 1111,//密码
position = new Box3Vector3(1, 1, 1)//三个数分别输入要传送x,y,z轴的坐标
if (key == value) {
entity.position = position
}
})
})2021-05-04T13:58:35 点赞:1