用户:
飞阁_Pallad查看:1 回复:5 评论:1 创建时间:2022-06-29T19:25:04
//我是寂.Alone 一个屑中屑今天来公开代码了(shop)(大佬勿喷)
const store = world.querySelector('#shop')
store.enableInteract = true
store.interactHint='武器商店'
store.interactRadius=4
store.onInteract(async({entity})=>{
const result = await entity.player.dialog({
type:'select',
title:'商店',
content:'你要买什么',
options:['自己写','自己写','自己写','自己写','自己写','自己写']
})
if(result){
if(result.index == 0){
if(entity.coin>99){
entity.coin-=100
entity.bag.push('物品名字')
entity.player.directMessage('购买成功')
}
}
if(result.index == 1){
if(entity.coin>199){
entity.coin-=200
entity.bag.push('物品名字')
entity.player.directMessage('购买成功')
}
}
if(result.index == 5){
if(entity.coin>1999){
entity.coin-=2000
entity.bag.push('物品名字')
entity.player.directMessage('购买成功')
}
}
if(result.index == 2){
if(entity.coin>499){
entity.coin-=500
entity.bag.push('物品名字')
entity.player.directMessage('购买成功')
}
}
if(result.index == 3){
if(entity.coin>199){
entity.coin-=200
entity.bag.push('物品名字')
entity.player.directMessage('购买成功')
}
}
if(result.index == 4){
if(entity.coin>999){
entity.coin-=1000
entity.bag.push('钩爪')
entity.player.directMessage('购买成功')
}
}
}
})