Cmdr: A fully extensible and type safe command console for Roblox Developers

admins = {
	[40527673] = true,
	[482217345] = true
}

return function (registry)
	registry:RegisterHook("BeforeRun", function(context)
		if context.Group == "DefaultAdmin" and not admins[context.Executor.UserId] then
			return "You don't have permission to run this command"
		end
		if context.Group == "Moderator" and not (context.Executor:GetRankInGroup(3904755) == 4) then
			return "You don't have permission to run this command"
		end
		registry:RegisterHook("AfterRun", function(context)
			print(context.Response)
			return "Command has been run."
		end)
	end)
end

This is what i’ve tried to do, have a list of admins and moderators by group rank

The problem is with the command group property, how do i allow for multiple groups to use that one command?

Like if i wanted both mod and admin to be able to use /fly then what would i change in Group = “DefaultAdmin”;?

1 Like

If you want administrators to use commands under the Moderator group, add and not admins[context.Executor.UserId] to the if statement checking if the command’s group is Moderator.

Side note, you should remove the AfterRun hook if you are not using it.

2 Likes

This is one of the commands, where would I add that in?
image

If you wish to allow moderators to use that command, change the Group property to Moderator.

2 Likes

I appreciate your help and I’m sorry for asking so much but what if I want the admins to be able to use that command too?

You should add and not admins[context.Executor.UserId] to the if statement checking if the executor can execute a command in the Moderator group.

1 Like

The last release of this was in 2020, is there still active development on this?

Yes, the project is still maintained. Cmdr is mostly stable, there are some new changes if you build from source. I’ll cut a new release here in a few weeks, probably.

2 Likes

sry, what’s the keybind to open the ui ? i tried f2

1 Like

You have to set the keybind yourself as stated in the tutorial.

1 Like

I don’t like the fact that Cmdr magically parents itself to a bunch of replicated Instances on require. I have a use case where I’d prefer for it to be impossible to detect Cmdr’s existence from any client that doesn’t have access to the console. This is currently possible by using a pool of Cmdr instances that were initialized on server startup, before any players have joined, and then had their instances yoinked from StarterGui and ReplicatedStorage, but that is like the hackiest hack I’ve ever done and it’s utterly disgusting.

2 Likes

I can’t figure out how to set this up. Please help

@qwertyexpert Why would you have to do that? Only exploiters would be able to view the modules that are replicated to the client.


@regexman Please follow the Cmdr setup guide.

1 Like

I followed it and it dosent work at all, .

The point of controlling what is replicated to the client is to prevent exploiters from seeing what you don’t want them to. I don’t want them to know my place has an admin console. Cmdr could support that use case, but it doesn’t.

@regexman What errors are you receiving in the Output window?


@qwertyexpert You can setup hooks to disable command execution from unauthorized users.

1 Like

I already have hooks to prevent unauthorized usage. I just don’t want a huge pile of ModuleScripts to be replicated to every client when only authorized devs can actually use it.

This is really the best admin system, I’ve seen out there!

Are you able to set group rank commands with this? Edit: I figured it out.

It’s not like exploiters can use the modulescripts for bad (assuming Cmdr is secure), so there is really no reason to worry about replication when the source code is online…