Simple Lua help

Hello guys,

I got a small problem with my code.
What am I doing wrong with it? I know its sooo easy but I am very tired and I cant find the problem.
Nope I am not getting any errors.

Code:

pretty sure this
[LUA]for k,v in next(userdatazumeinfuegen) do[/LUA]
has to be this:
[LUA]for k,v in pairs(userdatazumeinfuegen) do[/LUA]

Why are you using next in your for loop?
Also, you can just use
[lua]if userdatazumeinfuegen[ ply:SteamID() ] then
– Runconsolecommand
end[/lua]

I’d recommend using a different table structure.



local usertable = {
  ["STEAMID"] = "rank",
  ["STEAMID"] = "rank"
}


This way you can do.



for steamId, rank in pairs( usertable ) do
  RunConsoleCommand( "ulx", "adduserid", steamId, rank )
end


Also programming in German must be a pain since a bunch of German words are compounds of like 3 other words :v:

Thanks for the help! I’m testing that out!
I am not working a lot with “for xxxxxx go blah” lol ^^

I am always thankful for new things and new methods for doing something in a better way!