How do I make cmdr work with chat commands

How do I make cmdr work with chat commands

I want to be able to do stuff like tp/player1/player2 or kick/username as a quick way to run commands instead of opening up the console line

I still want the normal cmdr console line to work, but i just want to be able to have this as a shortcut but i dont know how to

1 Like

Hello!
So looking into Cmdr and using 1.8.4.


Step 1.
Finding the function to call commands and how they are evaluated.
Looking at the main Cmdr module script I see this:

-- Handle command invocations from the clients.
Cmdr.RemoteFunction.OnServerInvoke = function (player, text, options)
	return Cmdr.Dispatcher:EvaluateAndRun(text, player, options)
end

I then think, how can I use this to fire events.


Step 2.
Firing events from the client is done via the UI, so, why not just fire them when you do basic chat commands.

Chat commands are simple to set up and there are many sources out there on dev forum.
So I recommend looking into them.


Step 3.
After you have set up a basic chat command that works and you have tested it, I really just suggest looking into how the script above handles talking to the client.

You may have to make your own public event under ReplicatedStorage and modify how Cmdrs communicates, however, this may ruin Cmdrs safety and it can be risky.

But that is how I would go about looking into doing it.

Appreciate the help, thanks for your time

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.