Hey Guys, I've used many hours for the following thing and I just can't imagine what the problem could be. It's about the chat.AddText function. It seems like it's changing values that are given to it, even if it is a string. But here's the code:
function sendMessage(inumber, dnumber, x)
local inno = ""
local dete = ""
local lol = ""
inno = inumber
dete = dnumber
lol = x
if(CLIENT) then
chat.AddText(inno,dete,lol)
chat.AddText( color_white , "Diese Runde gibt es " , Color(0,235,0), inno , " Innocents, " , Color(0,0,235), dete, " Detectives", color_white, " und " , Color(255,7,0), lol, " Traitor.")
end
print ("i wrote "..lol)
end
The function gets the values inumber (Number of Innocents), dnumber (Number of Detectives) and x (Number of Traitors). The values are right, I did a print() function so I could check it. I've made them to a string ( local XYZ = tostring(ICount)) so they can be written down with chat.AddText. The "print ("i wrote "..lol)" should check if the lol value was given right to the function. It always writes down the right values that were send in the console. The only thing which does not work is the chat.Add() function. It says lol would be 1, even if it's 2 and the print function after the chat.Add() also says that lol is 2. Same with the other values. I just don't understand why it seems that only the chat.Add() changes the values, even if it's a string it changes the numbers.
Does anyone has an idea why or how to fix it?