addCommandHandler is the same, you can't change it to a different definition, so you have to change line 2.
Try this:
-- addCommandHandler supporting arrays as command names (multiple commands with the same function)
addCommandHandler = function( commandName, fn, restricted, caseSensitive )
-- add the default command handlers
if type( commandName ) ~= "table" then
commandName = { commandName }
end
for key, value in ipairs( commandName ) do
if key == 1 then
addCommandHandler( value, fn, restricted, caseSensitive )
else
addCommandHandler( value,
function( player, ... )
-- check if he has permissions to execute the command, default is not restricted (aka if the command is restricted - will default to no permission; otherwise okay)
if hasObjectPermissionTo( player, "command." .. commandName[ 1 ], not restricted ) then
fn( player, ... )
end
end
)
end
end
end