function arguments expected near

I get an error when i run my gamemode:

line: 57: function arguments expected near “jugger”

code:

line 55: function GM:OnRoundStart( )
line 56: lenght = table:Lenght
line 57: jugger = table[random(lenght) + 1]
line 58: jugger:SetClass ( CLASS_JUGGERNAUT )
line 59: end

I want it select a random player and make him the class juggernaut.
“table” is a table in which all players on the server are added.

It would help me a lot if someone could help me.

Line 56 should read:


lenght = table:Length()

(You misspelled “Length” and missed the Parenthesis (brackets) )

Line 57 should read:


jugger = table[math.random(lenght) + 1]

thank you for your quick response and it worked.
me and my stupid spelling mistakes =(

[editline]08:56PM[/editline]

well i dont get anymore errors for that, instead my game mode is unplayable and it has something to do with the table.

if i delete the line in which i create it, the mode works fine, with the exception of that a player is not randomly selected.

thanks for the help anyway.