#gui help

1 messages · Page 1 of 1 (latest)

olive skiff
#

i dont know the problem

steady yew
#

try changing runCommand with runCommandAsync but i dont think thats the issue

#

try checking what item.cost actually returns too

#

do like js player.sendMessage(`${item.cost}`)

#

then make sure on the slider

#

getScore(player, Money)

#

Money isnt in quotes

#

i dont know if its on purpouse

#

but for me it worked just fine

olive skiff
#

huh

#

u tried it and it worked

steady yew
#

i had to change a few thing cause you didnt provide the code for item.cost

#

and other variables

olive skiff
#

ohh

#

my bad

steady yew
#

is kits from kits/main.js the```js
if (kits) {
let kit = new ModalFormData()
.title(${item.name})...

#

?

olive skiff
#

huh

#

nvm

steady yew
#

the import { Kits } from './Kits/main.js';

olive skiff
#
import {createForm} from '../shop_main.js'
import BKits from './BKits.js'
import Kit from './Kit.js'

const category = "Kits"
const type = [
    {
        name: `Kits`,
        itemData: Kit,
        texture: `textures/ui/icon_armor`
    },
    {
        name:`BKits`,
        itemData: BKits,
        texture: `textures/ui/icon_armor`
    }
]

export function Kits(player) {
    createForm(player,type,category,true)
}
steady yew
#

itemData is like the identifier?

#

i can just put a test one like minecraft:grass

#

otherwise you have to give me the code of these two too
import BKits from './BKits.js'
import Kit from './Kit.js'

#

this is what i got

olive skiff
#

yes

steady yew
#

currency wasnt defined i put a $

olive skiff
#

kits

export default [
    {
        textures: 'textures/blocks/shulker_top_black',
        name: 'Test Kit',
        cost: 300,
        data: 0,
        item: 'Test_Kit'
    }
]```
#

BKits

export default [
    {
        textures: 'textures/blocks/shulker_top_white',
        name: 'God Kit',
        cost: 30,
        data: 0,
        item: 'God_Kit'
    }
]```
#

do u want me to give u the whole pack

steady yew
#

alright

#

no its fine

olive skiff
#

okay

steady yew
#

works fine for me

#

i had to change a a few things

#

this is Kit

#
const Kit = {
  Kit: [
    {
        textures: 'textures/blocks/shulker_top_black',
        name: 'Test Kit',
        cost: 300,
        data: 0,
        item: 'Test_Kit'
    }
  ]
}```
#

i mean i did all of this in one file thats why

#
const BKits = {
  BKits: [
    {
        textures: 'textures/blocks/shulker_top_white',
        name: 'God Kit',
        cost: 30,
        data: 0,
        item: 'God_Kit'
    }
  ]
}```
#

this is BKits

#

this is on the Kits/main

#
const category = "Kits"
const type = [
    {
        name: `Kits`,
        itemData: Kit.Kit,
        texture: `textures/ui/icon_armor`
    },
    {
        name:`BKits`,
        itemData: BKits.BKits,
        texture: `textures/ui/icon_armor`
    }
]```
#

then i did these two because they werent declared

#

let currency = '$'
let Money = 'money'

#

thats all i changed

olive skiff
#

okay did u click on the kit

#

look

#

thats whats suppose to pop up

steady yew
#

ohh

#

wait

steady yew
olive skiff
#

how

steady yew
#

i changed a bit

#

of stuff

#

like

#
export function Kits(player) {
  createForm(player,type,category,false,true)
}```
#
export function createForm(player, type, category, enchanted = false, kits = 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, enchanted, kits )
      }
      if (result.selection == type.length) {
        Shops(player)
      }
    })
  } else {
    Transact(player, type, 0, enchanted, kits)
  } //this code may be wrong because i dont know when its the enchanted menu and when its the kits menu
}```
#

thats about it

olive skiff
#

ur a god

steady yew
#

there was an issue in the createform function

steady yew
#

lol