if (kits) {
let kit = new ModalFormData()
.title(`${item.name}`)
.slider(`§6-------------------------------\n\nUser Information:\nName: §b${player.name}\n§6Money: §b${currency}${money}\n\n§6Kit Information:\n§6Buy x1 §b${item.name} §6= §b${buy}\n§6-------------------------------\n\n§6`, 1)
kit.show(player).then(res => {
if (res.canceled) {
return Shops(player)
}
if (!item.cost && item.cost != 0) {
player.sendMessage(`§6SHOP §7>> §cWe don't sell item §f${item.name}§c currently. Please ask an admin.`)
player.playSound(`note.bass`)
return
}
let dataCost = item.cost
if (dataCost <= money) {
player.runCommand(`scoreboard players remove @s ${Money} ${dataCost}`)
player.sendMessage(`§6SHOP §7>> §aYou have purchased §eKit ${item.name} §afor : §e${currency}${dataCost}`)
player.runCommand(`structure load ${item.name} ~~~`)
} else {
player.sendMessage(`§6SHOP §7>> §cInsufficient currency. you need atleast §e${currency}${dataCost} §cto buy §elevel ${level} ${item.name}§c.`)
player.playSound(`note.bass`)
}
})
}
#Shop Gui
1 messages · Page 1 of 1 (latest)
console.warn(kits)
where
before "if (kits)"
it gave me a warning it said false
then it wont trigger
how do i fix that
wait i messed it up
console.warn(kits)
if (kits) {
let kit = new ModalFormData()
.title(`${item.name}`)
.slider(`§6-------------------------------\n\nUser Information:\nName: §b${player.name}\n§6Money: §b${currency}${money}\n\n§6Kit Information:\n§6Buy x1 §b${item.name} §6= §b${buy}\n§6-------------------------------\n\n§6`, 1)
kit.show(player).then(res => {
if (res.canceled) {
return Shops(player)
}
if (!item.cost && item.cost != 0) {
player.sendMessage(`§6SHOP §7>> §cWe don't sell item §f${item.name}§c currently. Please ask an admin.`)
player.playSound(`note.bass`)
return
}
let dataCost = item.cost
if (dataCost <= money) {
player.runCommand(`scoreboard players remove @s ${Money} ${dataCost}`)
player.sendMessage(`§6SHOP §7>> §aYou have purchased §eKit ${item.name} §afor : §e${currency}${dataCost}`)
player.runCommand(`structure load ${item.name} ~~~`)
} else {
player.sendMessage(`§6SHOP §7>> §cInsufficient currency. you need atleast §e${currency}${dataCost} §cto buy §elevel ${level} ${item.name}§c.`)
player.playSound(`note.bass`)
}
})
}
like this
the console warn
heres the code
Program Output
(node:22) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/home/jail/prog.js:1
export function Transact(player, type, index,
7uckx#0000 | javascript | nodejs-16.14.0 | wandbox.org
yo
enchants loads a differnt ui from ther rest
i need thta for kits aswell but it not load the kits ui
how do u use Transact
like where do u use Transact function
export function createForm(player, type, category, isEnchantment = false) {
if (type.length > 1) {
selectionForm(player, type, category).then(result => {
if (result.canceled) return
if (result.selection < type.length) {
Transact(player, type, result.selection, isEnchantment)
}
if (result.selection == type.length) {
Shops(player)
}
})
} else {
Transact(player, type, 0)
}
}
export function createForm(player, type, category, isEnchantment = false) {
if (type.length > 1) {
selectionForm(player, type, category).then(result => {
if (result.canceled) return
if (result.selection < type.length) {
Transact(player, type, result.selection, isEnchantment)
}
if (result.selection == type.length) {
Shops(player)
}
})
} else {
Transact(player, type, 0)
}
}
Transact(player, type, 0, false, true)
\n§6-------------------------------\n\n§6`, 1, 9, 1)
where
in the slider
for kits???
make it like this
it worked
yay
thanks a bunch
wc 