Kazafka Posted January 4, 2020 Share Posted January 4, 2020 Why this thing doesn't work? for k, v in ipairs(accounts) do if(not string.match(getPlayerName(player), v)) then --some code end end when accounts table is {} And username is "VaporZ" I tried a lot but it kept not working. Help me. Link to comment
Moderators Patrick Posted January 4, 2020 Moderators Share Posted January 4, 2020 Quote string.match (s, pattern [, init]) Looks for the first match of pattern in the string s. If it finds one, then match returns the captures from the pattern; otherwise it returns nil. If pattern specifies no captures, then the whole match is returned. A third, optional numerical argument init specifies where to start the search; its default value is 1 and can be negative. http://www.Lua.org/manual/5.1/manual.html#pdf-string.match Do you want to check is v not equals player's name? If yes, you need to do something like this: for k, v in ipairs(accounts) do if v ~= getPlayerName(player) then -- if v not equals player's name --some code end end Link to comment
Kazafka Posted January 4, 2020 Author Share Posted January 4, 2020 2 minutes ago, stPatrick said: http://www.Lua.org/manual/5.1/manual.html#pdf-string.match Do you want to check is v not equals player's name? If yes, you need to do something like this: for k, v in ipairs(accounts) do if v ~= getPlayerName(player) then -- if v not equals player's name --some code end end Yeah, I'll check that. 4 minutes ago, stPatrick said: http://www.Lua.org/manual/5.1/manual.html#pdf-string.match Do you want to check is v not equals player's name? If yes, you need to do something like this: for k, v in ipairs(accounts) do if v ~= getPlayerName(player) then -- if v not equals player's name --some code end end However not working BRO Link to comment
Moderators Patrick Posted January 4, 2020 Moderators Share Posted January 4, 2020 8 minutes ago, VaporZ said: Yeah, I'll check that. However not working BRO send the full code dude, its not enough info Link to comment
Kazafka Posted January 4, 2020 Author Share Posted January 4, 2020 Just now, stPatrick said: send the full code dude, its not enough info 'k, wait please, Im trying to figure it out another way... Link to comment
Moderators Patrick Posted January 4, 2020 Moderators Share Posted January 4, 2020 Just now, VaporZ said: 'k, wait please, Im trying to figure it out another way... any error? Link to comment
Kazafka Posted January 4, 2020 Author Share Posted January 4, 2020 No, but my way to check if v ain't got any player names doesn't just work still, same's your way. Funny thing is, that earlier at like 12 o'clock am today it worked 6 minutes ago, stPatrick said: any error? ^ EY PATRICK THAT STARTED CREATING PROBLEMS AGAIN XD Ok At this case, I will try to write this script up again, tomorrow, to see, what it will be creating. I regret my choice, to delete older version of script. It was working :''''((( Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now