Check for boolean failing...

Well, i have this check for booleans in my for loop. if its a boolean, then check if its true, then say (as a string) either “true” or “false”. But the problem is, i dont want it all to be tostring’d do i have to add if checks. The other problem is, its STILL SAYING




:14731: attempt to index local 'v' (a boolean value)



Also, where the fuck is 14731, what file, and if it is a file, thats A LONG ASS FILE!
Anyway, heres the code that is relavant i think

[lua]
for k,v in pairs(decoded) do
if(type(v) == “boolean”) then
if(v == true) then
LastSql[k] = “true”
else
LastSql[k] = “false”
end
else
LastSql[k] = v
end
end
[/lua]
Grrrrr, help please?

Which line in your snippet is the line in the error?

edit: Oops I can’t read. This seems rather strange.

[lua]if(tobool(v) == true) then[/lua]

Tried that?

Other than that, debugging!

[lua]
print(type(v))
print(v)
[/lua]

ok will try both.