#CmdR Bug

1 messages · Page 1 of 1 (latest)

karmic python
#

Im new to Cmdr and i've made 2 commands, but when i tried making this one, it wouldn't pop up in the command bar.

#

summon - ```lua
return {
Name = "summon";
Aliases = {"s"};
Description = "Spawn NPCs around the Spawn part.";
Group = "DefaultAdmin";
Args = {
{
Type = "enum";
Name = "modelName";
Description = "Choose a model to spawn";
EnumValues = {"Noob", "Bacon"};
},
{
Type = "number";
Name = "amount";
Description = "How many to spawn";
},
};
}

#

i mean uh

#

summon

#

summonServer - ```lua
return function(context, modelName, amount)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")

local spawnPart = Workspace:FindFirstChild("Spawn")
if not spawnPart then
    return "Error: No 'Spawn' part found in Workspace."
end

local modelsFolder = ReplicatedStorage:FindFirstChild("Models")
if not modelsFolder then
    return "Error: No 'Models' folder found in ReplicatedStorage."
end

local modelToSpawn = modelsFolder:FindFirstChild(modelName)
if not modelToSpawn then
    return "Error: Model '" .. modelName .. "' not found."
end

amount = math.clamp(amount, 1, 100)

for i = 1, amount do
    local clone = modelToSpawn:Clone()

    local randomX = spawnPart.Position.X + (math.random() - 0.5) * spawnPart.Size.X
    local randomZ = spawnPart.Position.Z + (math.random() - 0.5) * spawnPart.Size.Z
    local yPos = spawnPart.Position.Y + spawnPart.Size.Y / 2

    clone:PivotTo(CFrame.new(randomX, yPos, randomZ))

    clone.Parent = Workspace
end

return ("Spawned %d %s(s) around Spawn."):format(amount, modelName)

end

#

tried fixing it with chat gpt

#

still doesnt woork

karmic python
#

Bump