#Im new to cmdr why wont this work?
1 messages · Page 1 of 1 (latest)
🤤
Yeah
Catbox ur screenshots
In text?
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
@clever python
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
?????????????
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