#Problem with updating the GUI

1 messages · Page 1 of 1 (latest)

prisma crypt
#

Currently im having the problem with my GUI that its not updating correctly.

Description: When I click on index slot 5 everything after slot 5 is gonne dissepear, And I don't know why its doing that.

Code:

function updatePandenMenu(p: player, page: number):
    loop 25 times:  # Change loop to run 25 times
        clear {_index}
        set {_index} to (loop-value + (25 * ({_page} - 1)))
        set {_item} to {huis::%{_index}%::item}
        stop loop if {huis::%{_index}%} is not set
        set slot (loop-value -1) of (metadata tag "huur.adminMenu.panden" of {_p}) to {huis::%{_index}%::item} ? "{@standaard-item}" parsed as item named "&a&lPAND: &f%{huis::%{_index}%}%" with lore "%nl%&8↳ &7Klik rechtermuis-knop om bij te werken%nl%&8↳ &cKlik linkermuis-knop om te verwijderen"
    set slot 40 of (metadata tag "huur.adminMenu.panden" of {_p}) to barrier named "&cGa terug" with lore "&7&oKlik om terug te gaan"
    set slot 27,28,29,30,31,32,33,34 and 35 of (metadata tag "huur.adminMenu.panden" of {_p}) to red stained glass pane named " "
    set slot (integers from 45 to 53) of (metadata tag "huur.adminMenu.panden" of {_p}) to arrow
    if (metadata tag "huur.adminMenu.panden.page" of {_p}) != 1:
        set slot 26 of (metadata tag "huur.adminMenu.panden" of {_p}) to arrow
    if ((metadata tag "huur.adminMenu.panden.page" of {_p}) * 25) < size of {huis::*}:
        set slot 26 of (metadata tag "huur.adminMenu.panden" of {_p}) to arrow