Nill value issue

hello, i wanted to make admin commands but it gives this error:
ServerScriptService.Server:33: attempt to call a nil value

my script:

game.ReplicatedStorage.CommandsModule.ServerRemote.OnServerEvent:Connect(function(plr,cmd,IsPlayerCmd,Function,prefix)
    print("server fired")
    table.insert(cmds,cmd)
    plr.Chatted:Connect(function(mess)
        for _, cmd in pairs(cmds) do
            if string.match(string.lower(tostring(mess)),string.format("%s"..cmd,prefix)) ~= nil and IsPlayerCmd == false then
                local args = string.split(mess, " ")
                table.remove(args,1)
                Function(table.concat(args," ")) 
            elseif string.match(string.lower(tostring(mess)),string.format("%s"..cmd,prefix)) ~= nil and IsPlayerCmd == true then
                local args = string.split(mess, " ")
                table.remove(args,1) 

                local function GetPlayer()
                    if args[1] == "me" then
                        return game.Players:FindFirstChild(tostring(plr))
                    end

                    if args[1] == "all" then
                        for i, v in pairs(game.Players:GetChildren()) do
                            Function(v,string.gsub(table.concat(args," "),tostring(args[1]),""))
                        end
                    end

                    if game.Players:FindFirstChild(args[1]) then
                        return game.Players:FindFirstChild(args[1])
                    end
                end

                if GetPlayer() ~= nil then
                    Function(GetPlayer(),string.gsub(table.concat(args," "),tostring(args[1]),""))
                end
            end
        end
    end)
end)

According to the error, it is happening on line 33. Could you point out which line is line 33 since I cannot see the line numbers.

its

Function(GetPlayer(),string.gsub(table.concat(args," "),tostring(args[1]),""))

I am pretty sure args is nil for some reason, since the error occurred because it tried to call a nil value.

Use print(args) before the error and see if it prints nil.

I am assuming the error is occuring inside the GetPlayer() function. Review it and check for any errors that might print out nil?

i found the issue already, its fixed