It looks like your commas are in the wrong place or something. I tried changing the words to word[random num] and tested it out.
my chat log=
at the end i removed all words in the script and made it 1 "word12".
test log
1
word41
i love word word12
chest1
word12
check2
testing
So i would expect it's based on where the words are in relationship to commas and spaces (i don't know much about variables, so don't know what to do there)