I have a problem: In this following excerpt, the function runs until it hits “if ply:Nick() == v then”.
I see no reason for it to fail.
Inside names.txt is:
function suggestionstart( ply, txt ) local names = file.Read("names/names.txt") local player = string.Explode(" ", names) for k, v in pairs(player) do if ply:Nick() == v then sOn = 1 timer.Create("sugOn", 2, 1, RunConsoleCommand, "say", "Suggestion Bot is now online! To make a suggestion, type !s <suggestionhere> to make your suggestion.") else break end end end hook.Add("OnPlayerChat","startsuggestion",suggestionstart)
Please help, thanks.