Print debugging
For instances where you get unexpected results with no error messages, it often means some condition for a certain code block wasn't met. This is a good sign, because it means your program has a way of handling a situation where something is out of place. Unfortunately, it can get a little bit frustrating to debug sometimes. But, let's not forget about one of the greatest debugging tools out there: the print function.
Locate the problem
Locate the region in your script that's causing the problem, and try placing a print function after (and optionally, before) each conditional statement. The print message should be somewhat descriptive about the condition.
print("Checking if table has pie...")
if randomTable.piethen then
print("Table indeed has pie")
end
You should keep doing this for each conditional statement relevant to your problem, and analyze the output window very carefully to see the runtime progression of your code. In your case, it probably has something to do with char either not being a string, or just not containing the same characters as "Chris", but this would just be an educated guess. You should gather this data first, and if you still haven't found the issue, report back with the information you gathered.
3 comments
Fixed it myself!
I suppose the problem was that you used Chris instead of "Chris"?
No lol