#Duel Skript requests

1 messages · Page 1 of 1 (latest)

vocal glen
wary lark
#

have you tried debugging?

vocal glen
wary lark
#

broadcast some stuff

  • add messages after conditions so you can see if they pass/fail
  • broadcast values to see what they are
vocal glen
#

So I've changed

function DuelRequests(p: player):
    create a gui with virtual chest inventory with 5 rows named "          &e&lDuel Requests":
        # Do something please pookie :)
        loop {duel.request::*}:
            broadcast "looping through duel requests for %loop-value%"
            if {duel.request::%loop-value%} is true:
                broadcast "duel request for %loop-value% is set"
                add 1 to {_slot}
                format gui slot {_slot} with written book of mending named "&a%loop-value%" with lore "&7Click to accept the duel request from &a%loop-value%."
            
            ```
#

and this is all its getting too

wary lark
#

so broadcast the variable

#

and see what it is

#

ah

#

youre using loop-value, i think you want loop-index

#

although, you can filter it to avoid looping extranous stuff in the first place

#

loop {duel::*} where [input = true]:

vocal glen
#

Ah yes that shows correctly in the gui thanks

wary lark
#

loop-index is a text

#

youd need to parse as a player

vocal glen
wary lark
#

youre comparing a list to a singular

#

{duel.request::%{_p}%::*} is true

#

also please disable reply pings

vocal glen
#

Sorry

vocal glen
wary lark
#

are you tring to loop {duel.request::%{_p}%::*} then?

#

also that variable should use a uuid

vocal glen
#

which would be that yes

#

I mean I could change it to be if {duel.request::%{_p}%::*} is set:

wary lark
#

no

wary lark
vocal glen
wary lark
#

you only want that player's requests though, right? not all requests from all players to all players?

vocal glen
#

Yeah

wary lark
#

only that player's incoming requests

vocal glen
#

I do only want that players requests

#

Could I do something like

#

set {duel.request::%{_p}%::%loop-index%::slot} to {_slot}

#

nvm that wouldn't work

wary lark
#

you have loop {duel.request::*}. you want loop {duel.request::%{_p}%::*}:

vocal glen
#

This is what I have now

wary lark
#

okay

#

loop-value = true