Attempt to concatenate nil with string

for i,v in pairs(messagesFolder:GetChildren()) do
	print(v.content.Value)
	StringChatLog = StringChatLog .. [[
	; ]]
	..v.Name .. [[
	Author: ]] ..v:WaitForChild("author").Value ..[[
	Content: ]] ..v.content.Value -- error apearing here
end

why sometimes my topics doesn’t appears in “last” tab?

My theory is that StringChatLog is nil, did you check if all the other variables are nil?

1 Like

i replaced nil to “empty” and it’s worked.
thx

local stringA = "aaa"
stringA ..= "aaa"
print(stringA) --aaaaaa

You may already be aware of compound operators in the form of (+= and -= etc.), however a compound operator also exists for the concatenation operator and it follows a similar form/style to the other compound operators (as seen in the provided code snippet above).

1 Like