#Can somebody help? i have to exit any forms 3 times before im able to exit fully (video example)

1 messages · Page 1 of 1 (latest)

frail pine
#

sending code now

#

damn

#

gotta send in parts

#
import { Player, system, world, DynamicPropertiesDefinition, MinecraftEntityTypes } from "@minecraft/server";
import { ActionFormData, ModalFormData, MessageFormData, FormCancelationReason, ModalFormResponse } from "@minecraft/server-ui";
world.afterEvents.itemUse.subscribe(data => {
    if (data.itemStack.typeId === "bridge:pveguiitem" && data.source.typeId === 'minecraft:player')
        mainPage(data.source);
});
export function getScore(target, objective) {
    try {
        return world.scoreboard.getObjective(objective).getScore(typeof target === 'string' ? oB.getParticipants().find(pT => pT.displayName == target) : target.scoreboardIdentity)
    } catch {
        return 0
    }
}
export function mainPage(player) {
    try {
        const mainMenu = new ActionFormData()
            .title("§l§cOrison§3PVE")
            .body(` ¦ ${player.name}\n§f ¦ §c$§s${getScore(player, `money`)}\n§f ¦ §7[§d${getScore(player, `Level`)}§7] §f${getScore(player, `battlePassXp`)}/${getScore(player, `neededXp`)}`)
            .button("§l§bWarps§r\n§8[Click to View]", "textures/items/ender_pearl") //button that players click
            .button("§l§bReport a bug§r\n§8[Click to View]", "textures/items/diamond")
            .button("§l§bCredits§r\n§8[Click to View]", "textures/items/glowstone_dust")
            .button("§l§bMoney Transfer§r\n§8[Click to View]", "textures/items/emerald")
            .button("§l§bRules§r\n§8[Click to View]", "textures/items/paper")
            .button("§l§bCode Redeem§r\n§8[Click to View]", "textures/items/expgui")
            .button("§l§bStats§r\n§8[Click to View]", "textures/items/amethyst_shard")
            
            ```
#
mainMenu.show(player).then((response) => {
            switch (response.selection) {
                case 0:
                    Warps(player)
                    break;
                    case 1:
                    bugs(player)
                    break;
                    case 2:
                    Credits(player)
                    break;
                    case 3:
                    moneyTransfer(player)
                    break;
                    case 4:
                    rules(player)
                    break;
                    case 5:
                    codeMenu(player)
                    break;
                    case 6:
                    player.sendMessage(`§dSTATS\n§f • §bLightning : ${getScore(player, `lightningI`)}\n§f • §6Zombie Killer : ${getScore(player, `zombiek`)}\n§f • §7Skeleton Killer : ${getScore(player, `skeletonk`)}\n§f • §8Slowness : ${getScore(player, `slowI`)}`)
                    break;
                                     
            }
        })
    } catch (error) {
        console.warn(error.stack)
    }
}
#
world.afterEvents.entityHitEntity.subscribe(data => {
    if (data.hitEntity.hasTag("shopBot")) {
        let player = data.damagingEntity
        if (!(player instanceof Player)) return;
        let stats = data.entityHitEntity
        let classMenu = new ActionFormData()
        .title(`§bShop`)
        .body("§dChoose a set to buy!")            
        .button("§f§lIron Set\n§r§7[Click To View]", "textures/items/iron_chestplate")
        .button("§b§lDiamond Set\n§r§7[Click To View]", "textures/items/diamond_chestplate")
        .button("§0§lNetherite Set\n§r§7[Click To View]", "textures/items/netherite_chestplate")
        console.warn(player)
    classMenu.show(player).then(response => {
        if (response.selection === 0) {
            ironBuy(player)
        }
        if (response.selection === 1) {
            diamondBuy(player)
        }
        if (response.selection === 2) {
            netheriteBuy(player)
        }

        })
    }
})```
#

first 2 parts are the item and 3rd is one of the npc menus

#

this is on realms btw

#

so dk if thats possibly a realms issue

wintry cave
#

so problem is also with that npc menu as well?

frail pine
#

YEAH

#

yeah*

wintry cave
frail pine
#

ill try now

wintry cave
#

issue could be also that you have similar 3 packs on the realms so you have duplicated scripts running the same things

frail pine
#

i mean their is 2 unknown packs that appeared out of no where when i checked today

#

no issue on client side

#

oh

#

it must have been that then

frail pine
wintry cave
#

👍