#Shop Gui

1 messages · Page 1 of 1 (latest)

steep widget
#
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`)
        }
      })
    }
#

that is what im trying to show^^^

clear gazelle
#

console.warn(kits)

steep widget
#

where

clear gazelle
#

before "if (kits)"

steep widget
#

it gave me a warning it said false

clear gazelle
#

then it wont trigger

steep widget
#

how do i fix that

clear gazelle
#

make it true...

#

show the other code

steep widget
#

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

red escarpBOT
#
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, 
steep widget
#

yo

#

enchants loads a differnt ui from ther rest

#

i need thta for kits aswell but it not load the kits ui

clear gazelle
#

how do u use Transact

steep widget
#

wdym

#

im pretty new to coding

clear gazelle
#

like where do u use Transact function

steep widget
#
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)
  }
}
clear gazelle
#
Transact(player, type, 0, false, true)
steep widget
#

now im getting an error

#

only for kits tho

clear gazelle
#
\n§6-------------------------------\n\n§6`, 1, 9, 1)
steep widget
#

where

clear gazelle
#

in the slider

steep widget
#

for kits???

clear gazelle
#

kit form

#

idk, change those numbers as u like

steep widget
#

it worked but i have a new problem

#

its loading the else ui also

clear gazelle
#

make it like this

steep widget
#

it worked

clear gazelle
#

yay

steep widget
#

thanks a bunch

clear gazelle
#

wc bao_foxxo_smile

steep widget
#

yo

#

@clear gazelle

#

new probelm

#

yo

#

anyone pls

#

hello