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) 1 hour ago, xiRocKyz said: Here you go: characters = {"a", "b", "c"} function test(username) if string.find(username, "["..table.concat(characters, "").."]") then end end 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 20:57, xXGhostXx said: Working because i want add allowing characters in table. Help me Link to comment
Rockyz Posted October 23, 2019 Share Posted October 23, 2019 2 hours ago, xXGhostXx said: Help me Could you explain what is the problem ? Link to comment
xXGhostXx Posted October 23, 2019 Author Share Posted October 23, 2019 2 hours ago, xiRocKyz said: Could you explain what is the problem ? 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 20:51, xiRocKyz said: Could you explain what is the problem ? help! Link to comment
Moderators IIYAMA Posted October 27, 2019 Moderators Share Posted October 27, 2019 5 minutes ago, xXGhostXx said: help! 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