At the end of this verse there is a break stop in the main story. John tells the reader how this event fulfills Scriture. (See: [[rc://en/ta/man/jit/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/jit/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"