At the end of verse 24 there is a break from the main story line as John tells the reader how this event fulfills Scriture. (See: [[rc://en/ta/man/translate/writing-background]])
The soldiers will gamble and the winner will receive the shirt. Alternate translation: "let us gamble for the tunic and the winner will get to keep it" (See: [[rc://en/ta/man/translate/figs-explicit]])
You can translate this in an active form. Alternate translation: "This fulfilled the scripture that said" or "This happened to make the scripture come true which said"