Alright, thank you. Do you know how to get the Group property within the commanddefinition?
return {
Name = "kick",
Aliases = {"boot"},
Description = "Kicks a player",
Group = {"Creators", "Administrators"}, -- want to get this in my BeforeRun
Args = {
{
Type = "player",
Name = "target",
Description = "The player being kicked"
},
{
Type = "string",
Name = "reason",
Description = "The reason for kicking this player"
}
}
}
I found this very useful, But I did (kinda) run into an issue while Making a gravity Command.
It works fine with numbers but I want to it be a
Number or “Default”
I like that It has typechecks, But I want to cram multiple types into one function. Like number|"Default"|"Random"
For now I am just using a ResetGravity function. and CrazyGravity
I suggest developing a custom number type tailored to your specific scenario instead of relying on the default number type. You can refer to the Types guide for a detailed example of how to create a custom type that suits your needs.
Hello, thank you for taking the time to read my comment.
I do have a question/suggestion and it is regarding future plans for management of team’s;
Is there plans for group permissions and or, management features, such as roles in groups giving specific permissions?
this project seems it would have benefits with more gravitas if it was optimised for group ID’s and rank’s allowing more genuine control over administrative features for multiple users.
Other than this small overlook, I feel this is an extremely powerful resource and I’m intrigued by your project.
From reading, it seems to be an extensive module for intricate customisation via command’s.
To toggle the visibility of the console, you can utilize the CmdrClient:Toggle() method. However, you’ll need to develop your own method for detecting user input to determine when to invoke the method.
I have a error when I was making a command.
Error: TreasureName has an unregistered type "treasure"
Here’s Treasure Module:
return {
Name = "treasure";
Aliases = {"tr"};
Description = "Adding/Subbing treasure from player.";
Group = "Creators";
Args = {
{
Type = "player";
Name = "Player";
Description = "The Player whose treasure we want to add/sub";
},
{
Type = "treasure";
Name = "TreasureName";
Description = "The name of the treasure we want to modify";
},
{
Type = "addsub";
Name = "Add/Sub";
Description = "The string of what we want to do with coins value";
}
}
}
Here’s TreasureServer Module:
return function(context, player: Player, ttype, addsub: string)
local treasuresFound = player:FindFirstChild("leaderstats")["Treasures Found"]
local treasuresData = player:FindFirstChild("Treasures")
if not treasuresData and not treasuresFound then return end
local function removeSpaces(str)
return str:gsub(" ","")
end local str = removeSpaces(ttype)
if addsub == "Add" or addsub == "add" then
treasuresData[str].Value = true
treasuresFound.Value += 1
elseif addsub == "Sub" or addsub == "sub" then
treasuresData[str].Value = false
treasuresFound.Value -= 1
end
end
Here’s Type Module for the treasure Type:
repeat task.wait() until game:IsLoaded()
local players = game:GetService("Players")
local player = players.LocalPlayer
local trNames = {}
for i,v in pairs(player:WaitForChild("Treasures"):GetChildren()) do
if v:IsA("BoolValue") then table.insert(trNames,v.Name) end
end
return function(registry)
registry:RegisterType("treasure", registry.Cmdr.Util.MakeEnumType("TreasureName", trNames))
end
I don’t know if I can asking for help here, if not then I’m sorry.
If someone can help, that would be really appreciated! Thanks.
local rs = game:GetService("ReplicatedStorage")
local cmdr = require(rs.Modules:WaitForChild("Cmdr"))
local folder = script.Parent
local commands = folder:FindFirstChild("Commands")
local hooks = folder:FindFirstChild("Hooks")
local types = folder:FindFirstChild("Types")
cmdr:RegisterDefaultCommands()
cmdr:RegisterCommandsIn(commands)
cmdr:RegisterTypesIn(types)
cmdr:RegisterHooksIn(hooks)
Are there any additional errors in the output window related to your custom type? Providing a screenshot of your complete output window would be greatly appreciated and helpful.