#Im new to cmdr why wont this work?

1 messages · Page 1 of 1 (latest)

slate ridge
#

theres an big error in the output also about dispatcher in line 85

#

the error in the output:

clever python
#

🤤

clever python
#

Yeah

slate ridge
#

so uh

#

i dont have discord on pc so

clever python
#

Catbox ur screenshots

slate ridge
#

In text?

slate ridge
# clever python Catbox ur screenshots
local module = {
    Name = "givekills";
    Aliases = { "gk" };
    Description = "Gives kills to the selected player(s).";
    Group = "DefaultAdmin";
    Args = {
        {
            Type = "players";
            Name = "players";
            Description = "Player(s) to give kills to.";
        },
        {
            Type = "number";
            Name = "amount";
            Description = "Kills to give.";
            Default = 1;
        }
    };
}

function module:Run(context, players, amount)
    if typeof(players) ~= "table" then
        players = { players }
    end
    
    for _, player in ipairs(players) do
        local statsis = player:FindFirstChild("leaderstats")
        if statsis then
            local kills = statsis:FindFirstChild("Kills")
            if kills and kills:IsA("IntValue") then
                kills.Value += amount
            end
        end
    end

    return ("Gave %d kill(s) to %d player(s)."):format(amount, #players)
end

return module
#
Error occurred while evaluating command string "givekills N0rmal_men1 12"
ReplicatedStorage.CmdrClient.Commands.givekills:27: attempt to index number with 'FindFirstChild'
ReplicatedStorage.CmdrClient.Shared.Dispatcher:81
ReplicatedStorage.CmdrClient.Commands.givekills:27 function Run
ReplicatedStorage.CmdrClient.Shared.Command:140 function Run
ReplicatedStorage.CmdrClient.Shared.Dispatcher:79
ReplicatedStorage.CmdrClient.Shared.Dispatcher:72 function EvaluateAndRun
ReplicatedStorage.CmdrClient.CmdrInterface:24 function ProcessEntry
ReplicatedStorage.CmdrClient.CmdrInterface.Window:166 function LoseFocus
ReplicatedStorage.CmdrClient.CmdrInterface.Window:318
- Dispatcher:85
slate ridge
uncut lotus
slate ridge
#

Whats wrong with it

clever python
slate ridge
#

Wrong format?

#

Why cant u just tell the issue🫡

clever python
slate ridge
#
local module = {
    Name = "givekills";
    Aliases = { "gk" };
    Description = "Gives kills to the selected player(s).";
    Group = "DefaultAdmin";
    Args = {
        {
            Type = "players";
            Name = "players";
            Description = "Player(s) to give kills to.";
        },
        {
            Type = "number";
            Name = "amount";
            Description = "Kills to give.";
            Default = 1;
        }
    };
}

function module:Run(context, players, amount)
    if typeof(players) ~= "table" then
        players = { players }
    end
    
    for _, player in ipairs(players) do
        local statsis = player:FindFirstChild("leaderstats")
        if statsis then
            local kills = statsis:FindFirstChild("Kills")
            if kills and kills:IsA("IntValue") then
                kills.Value += amount
            end
        end
    end

    return ("Gave %d kill(s) to %d player(s)."):format(amount, #players)
end

return module
#

Error occurred while evaluating command string "givekills N0rmal_men1 12"
ReplicatedStorage.CmdrClient.Commands.givekills:27: attempt to index number with 'FindFirstChild'
ReplicatedStorage.CmdrClient.Shared.Dispatcher:81
ReplicatedStorage.CmdrClient.Commands.givekills:27 function Run
ReplicatedStorage.CmdrClient.Shared.Command:140 function Run
ReplicatedStorage.CmdrClient.Shared.Dispatcher:79
ReplicatedStorage.CmdrClient.Shared.Dispatcher:72 function EvaluateAndRun
ReplicatedStorage.CmdrClient.CmdrInterface:24 function ProcessEntry
ReplicatedStorage.CmdrClient.CmdrInterface.Window:166 function LoseFocus
ReplicatedStorage.CmdrClient.CmdrInterface.Window:318

  • Dispatcher:85
slate ridge
#

?????????????

#

local module = {
Name = "givekills";
Aliases = { "gk" };
Description = "Gives kills to the selected player(s).";
Group = "DefaultAdmin";
Args = {
{
Type = "players";
Name = "players";
Description = "Player(s) to give kills to.";
},
{
Type = "number";
Name = "amount";
Description = "Kills to give.";
Default = 1;
}
};
}

function module:Run(context, players, amount)
if typeof(players) ~= "table" then
players = { players }
end

for _, player in ipairs(players) do
    local statsis = player:FindFirstChild("leaderstats")
    if statsis then
        local kills = statsis:FindFirstChild("Kills")
        if kills and kills:IsA("IntValue") then
            kills.Value += amount
        end
    end
end

return ("Gave %d kill(s) to %d player(s)."):format(amount, #players)

end

return module