猫史档案馆


商店の朴素代码(代码公开)

用户:飞阁_Pallad飞阁_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('购买成功')
            }
        }                      
    }
})


回复

上一页1 页 / 共 1下一页
飞阁_Pallad飞阁_Pallad

求大家给个顶吧

点赞0


评论


飞阁_Pallad飞阁_Pallad

今天也是我回归的第一天,所以公布了emm商店代码

点赞0


评论


某只sans喵呀某只sans喵呀

sofa

点赞0


评论


美男子阿宇美男子阿宇

               ()                              (寂()()())

点赞0


评论


SCS_user_rbxaHQh5aOSCS_user_rbxaHQh5aO

不行啊

点赞0


评论