Im tryna script keywords into my dialogue system. At first it works but when i click the next button and proceed i run into some issues.
I get this error.
ReplicatedFirst.LocalScript.ClientModule:127: invalid argument #2 to ‘format’ (number expected, got table)
local amountInDictionary = 0
for _, v in pairs(KeywordColors) do
amountInDictionary += 1
end
print("Amount", amountInDictionary)
for i = 0, string.len(Text) do
if DialogueSkippedValue.Value == false then
DialogueLabel.Text = string.sub(Text, 1, i)
for i, keyword in pairs(Keywords) do
if i <= amountInDictionary then
DialogueLabel.Text = string.gsub(string.lower(DialogueLabel.Text), string.lower(keyword), string.format("<font color='rgb(%i,%i,%i)'>", KeywordColors[i][1], KeywordColors[i][2], KeywordColors[i][3])..keyword.."</font>")
end
end
wait(Interval)
end
end
‘KeywordColors’ is {{100,50,90},{68,194,92}}
At first i thought i was larger than 2 so i implemented the amountInDictionary check but that didn’t work.