82 posts
Posted 19 August 2013 - 07:38 PM
Whenever I right click the player detector, nothing happens. At all. I've got my own username in the playerList file, too. No error comes up; just nothing happens.
http://pastebin.com/FRucq6TKOh, and I failed to mention that the chatRead() function is unfinished and should be disregarded.
758 posts
Location
Budapest, Hungary
Posted 20 August 2013 - 03:33 AM
I think the problem is with getPlayerData. First of all, it tries to open playerList
if it doesn't exist (playerList == false). Then (suppose it was able to open playerList) it tries to compare a string returned by .readAll with a boolean, which sure will evaluate false.
Next problem: around like 38, you open playerList (
opening it in "w" mode causes it to clear), and overwrite every name with a single one. Either you should use "a" (append) mode or you should store the usernames in a table
(tutorial about saving tables). And you should close the file handle somewhere as well (closing it is actually what flushes the contents of the file).
And use locals.
Here's what I thought it should look like. It should work, but I haven't tested it.