In one file, I have the following code:
module( "command" )
local Commands = { }
function Add( cmd, funccallback )
print(cmd)
Commands[ cmd ] = funccallback
end
Add("internal", function ( ) end )
in another I have the following:
command:Add("external", function( ) end )
this results in the following output:
>internal
>table: a008247
Why is the argument interpreted as an table in the second case?
Because you called it with
:instead of.. When you call something like this:That is syntactical sugar for:
You probably meant
command.Add.