xXGhostXx Posted October 21, 2019 Share Posted October 21, 2019 Hi guys. I try to use string.find with table. characters = { ["a"] = true, ["b"] = true, ["c"] = true, } function test (username) if string.find(username, characters[username]) then else outputChatBox("This is invalid character!",source) end end What is my problem ? Link to comment
Rockyz Posted October 21, 2019 Share Posted October 21, 2019 Here you go: characters = {"a", "b", "c"} function test(username) if string.find(username, "["..table.concat(characters, "").."]") then end end Link to comment
xXGhostXx Posted October 21, 2019 Author Share Posted October 21, 2019 (edited) On 21/10/2019 at 15:47, xiRocKyz said: Here you go: characters = {"a", "b", "c"} function test(username) if string.find(username, "["..table.concat(characters, "").."]") then end end Expand Working because i want add allowing characters in table. Edited October 21, 2019 by xXGhostXx Link to comment
xXGhostXx Posted October 23, 2019 Author Share Posted October 23, 2019 On 21/10/2019 at 17:27, xXGhostXx said: Working because i want add allowing characters in table. Expand Help me Link to comment
Rockyz Posted October 23, 2019 Share Posted October 23, 2019 On 23/10/2019 at 15:15, xXGhostXx said: Help me Expand Could you explain what is the problem ? Link to comment
xXGhostXx Posted October 23, 2019 Author Share Posted October 23, 2019 On 23/10/2019 at 17:21, xiRocKyz said: Could you explain what is the problem ? Expand Your code is working but i want add allowing characters in table. Link to comment
xXGhostXx Posted October 27, 2019 Author Share Posted October 27, 2019 On 23/10/2019 at 17:21, xiRocKyz said: Could you explain what is the problem ? Expand help! Link to comment
Moderators IIYAMA Posted October 27, 2019 Moderators Share Posted October 27, 2019 On 27/10/2019 at 15:16, xXGhostXx said: help! Expand Even after you received my warning, you are still continuing with bumping 2x. The content of those messages are not useful in anyway and very annoying for everybody, therefore I consider them as spam. https://forum.multitheftauto.com/topic/120659-help-stringfind/?do=findComment&comment=966942 https://forum.multitheftauto.com/topic/120659-help-stringfind/?do=findComment&comment=967139 Locked Link to comment
Recommended Posts