#upgarde to using wither skeleton skull

1 messages · Page 1 of 1 (latest)

fresh fossil
#

`export function stickUpgard(e) {
system.run(() => {
const ui = new ModalFormData();
ui.title('나무 몽둥이 업그레이드');

    // 슬라이더: 최소 1, 최대 100, step 1, 기본값 1
    ui.slider("업그레이드 수", 1, 99, { step: 1, defaultValue: 1 });

    ui.show(e).then(({ formValues }) => {
        if (!formValues) return; // 취소 시 종료
        const upgradeAmount = formValues[0];
        for (let i = 0; i < upgradeAmount; i++) {
            const obj = world.scoreboard.getObjective("level");
            const current = obj.getScore(e);
            obj.setScore(e, current + 1);
        }
    });
});

};
`
it has error
How can I make it so that players level up using Wither Skeleton Skulls?
level saved at 'level' scoreboard

#

full code :

coral ravine
#

Please write in English

forest lance
#

either this ```js

export function stickUpgard(e) {
system.run(() => {
const ui = new ModalFormData();
ui.title('나무 몽둥이 업그레이드');

    // 슬라이더: 최소 1, 최대 100, step 1, 기본값 1
    ui.slider("업그레이드 수", 1, 99, { valueStep: 1, defaultValue: 1 });

    ui.show(e).then(({ formValues }) => {
        if (!formValues) return; // 취소 시 종료
        let upgradeAmount = formValues[0];

        const obj = world.scoreboard.getObjective("level");
        // 위더 스켈레톤 머리 수만큼 루프
        while (upgradeAmount--) {
            // 플레이어의 level 스코어보드 1 증가
            obj.addScore(e, 1);
        }
    });
});

};or thisjs
export function stickUpgard(e) {
system.run(() => {
const ui = new ModalFormData();
ui.title('나무 몽둥이 업그레이드');

    // 슬라이더: 최소 1, 최대 100, step 1, 기본값 1
    ui.slider("업그레이드 수", 1, 99, { valueStep: 1, defaultValue: 1 });

    ui.show(e).then(({ formValues }) => {
        if (!formValues) return; // 취소 시 종료
        const upgradeAmount = formValues[0];
        const obj = world.scoreboard.getObjective("level");
        obj.addScore(e, upgradeAmount);
    });
});

};```

fresh fossil
forest lance
#

the upgradeAmount has the value. You can do something with that number, either using commands, test items, scores, and such