Jump to content

Whats mean (. . .)?


mrvicio

Recommended Posts

In your case, the "..." works as a table of arguments later used in table.find function.

Example of using "..." as argument:

addCommandHandler("text", 
function( player, command, ... ) 
    local text = table.concat({...}, " ") -- This way the player can type texts with [b][u]spaces[/u][/b]. 
    outputChatBox(tostring(text)) 
end) 

Link to comment

Each function that has "..." as parameter, passes another hidden table that is arg. So, you can use arg instead of creating new table with all parameters. In addition, arg table has a

addCommandHandler("text", 
function( player, command, ... ) 
    local text = table.concat(arg, " ") -- This way the player can type texts with spaces. 
    outputChatBox( text ); 
end) 

table.concat returns string so there is no need to convert it to string.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...