#Why it doesn't work?

1 messages · Page 1 of 1 (latest)

visual comet
#
    const getScore = (objective, target, useZero = true) => {
        try {
            const obj = world.scoreboard.getObjective(objective);
            if (typeof target === 'string') {
                return obj.getScore(obj.getParticipants().find(v => v.displayName === target));
            }
            return obj.getScore(target.scoreboard);
        } catch {
            return useZero ? 0: NaN;
        }
    }
visual comet
#

Please help

chrome fractal
#

what error do you get @visual comet

visual comet
chrome fractal
#

if (playerMoney < itemPrice) here playerMoney is a string : const playerMoney = "money"; could it be the problem ?

chrome fractal
#

well you are comparing a string to a number so

wicked condorBOT
#
Debug Result

There is an error in this [code](#1239468418491482273 message):

<repl>.js:3:26 - error TS2304: Cannot find name 'ChestFormData'.

3     const mainMenu = new ChestFormData('27')
                           ~~~~~~~~~~~~~