用户:Tobylai查看:27 回复:17 评论:27 创建时间:2020-05-13T08:52:22
这次送的是tobyCmd
功能:
/喵 xxxx
/tp name x y z
/tpto name entity
(要的说,超过10个就放代码)
world.command=world.createEntity()
world.command.id='命令'
function runCmd(cmd){
w=cmd.split(' ')
if(w[0]=='/喵'){
finder=0
world.querySelectorAll('player').forEach((m)=>{if(m.player.name==w[1]){finder=m}})
if(!finder==0){finder.hurt(finder.hp,{attacker:world.command,});world.say(`玩家 ${w[1]} 已被击杀`)}
else{world.say(`ERROR:NO PLAYER NAMED ${w[1]}`)}
}else if(w[0]=='/hurt'){
finder=0
world.querySelectorAll('player').forEach((m)=>{if(m.player.name==w[1]){finder=m}})
try{
if(!finder==0){finder.hurt(parseInt(w[2]),{attacker:world.command,});world.say(`玩家 ${w[1]} 已被伤害`)}else{world.say(`ERROR:NO PLAYER NAMED ${w[1]}`)}}catch{world.say('ERROR:Fail')}
}else if(w[0]=='/hp'){
finder=0
world.querySelectorAll('player').forEach((m)=>{if(m.player.name==w[1]){finder=m}})
try{
if(!finder==0){finder.hp=parseInt(w[2]);world.say(`玩家 ${w[1]} 血量已设置`)}else{world.say(`ERROR:NO PLAYER NAMED ${w[1]}`)}}catch{world.say('ERROR:Fail')}
}else if(w[0]=='/tpto'){
finder3=0
world.querySelectorAll('*').forEach((m)=>{
if(m.isPlayer){ if(m.player.name==w[1]){finder3=m}}
else if(m.id==w[1]){finder3=m}
})
finder4=0
world.querySelectorAll('*').forEach((m)=>{
if(m.isPlayer){ if(m.player.name==w[2]){finder4=m}}
else if(m.id==w[2]){finder4=m}
})
if(!finder3==0){
try{finder3.position.set(finder4.position.x,finder4.position.y+5,finder4.position.z)
}catch{world.say('ERROR:Fail');return};
world.say(`玩家 ${w[1]} 已被传送`)
}
else{world.say(`ERROR:NO PLAYER NAMED ${w[1]}`)}
}else{
world.say(`ERROR:NO COMMAD CALLED "${w[0]}"`)
}
}
调用方法:
runCmd('命令')
免费拿走,但是做作品要表明用了我的tobyCmd
------------------------------------------------
表明格式:
此地图用了 AC工作室toby 的 tobyCmd
------------------------------------------------
如果没有加上这个表明,我会直接举报
点赞1
评论