Why is my Adonis plugin command not working?

I attempted to make an adonis plugin command to change the nametag you have, and it doesn’t work at all.

When I run the command, it tells me that it’s not a valid command.

There’s not much on the DeveloperHub about adonis commands, and if someone who is good with adonis commands can help me out, that would be great.
Here’s the script:

--[[
	SERVER PLUGINS' NAMES MUST START WITH "Server: "
	CLIENT PLUGINS' NAMES MUST START WITH "Client: "
	
	Plugins have full access to the server/client tables and most variables.
	
	You can use the MakePluginEvent to use the script instead of setting up an event.
	PlayerChatted will get chats from the custom chat and nil players. 
	PlayerJoined will fire after the player finishes initial loading
	CharacterAdded will also fire after the player is loaded, it does not use the CharacterAdded event.
	
	service.HookEvent('PlayerChatted',function(msg,plr) 
		print(msg..' from '..plr.Name..' Example Plugin')
	end)
	
	service.HookEvent('PlayerJoined',function(p) 
		print(p.Name..' Joined! Example Plugin') 
	end)
	
	service.HookEvent('CharacterAdded',function(plr) 
		server.RunCommand('name',plr.Name,'BobTest Example Plugin') 
	end)
	
--]]

server = nil -- Mutes warnings about unknown globals
service = nil
return function()
	server.Commands.ExampleCommand = {
		Prefix = server.Settings.Prefix;	-- Prefix to use for command
		Commands = {"nametag","Nametag","NameTag"};	-- Commands
		Args = {"NameOrRank","NewText"};	-- Command arguments
		Description = "Edits the nametag of the player running the command";	-- Command Description
		Hidden = true; -- Is it hidden from the command list?
		Fun = false;	-- Is it fun?
		AdminLevel = "Owners";	    -- Admin level; If using settings.CustomRanks set this to the custom rank name (eg. "Baristas")
		Function = function(plr,args)    -- Function to run for command
			if args[1] and type(args[1]) == "string" and (args[1]:lower() == "Name" or args[1]:lower() == "name") then
				plr.Character.Head.NameGui.TextLabel.Text = args[2]:lower()
			elseif args[1] and type(args[1]) == "string" and (args[1]:lower() == "Rank" or args[1]:lower() == "rank") then
					plr.Character.Head.RankGui.TextLabel.Text = args[2]:lower()
			
			end
		end
	}
end

I figured it out, I had to change server.Commands.ExampleCommand to the name of my command.

2 Likes