Adonis admin server.RunCommand() "attempt to call a nil value" error

So I have tried using the server.RunCommand() function in a custom command module but whatever I do I just get “attempt to call a nil value” error. I tried looking at the DevForum but it seemed like it worked for others unless I’m doing something wrong but I’m not sure what to do at this point.

--[[
	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.RunCommandTestCommand = {
		Prefix = server.Settings.Prefix;	-- Prefix to use for command
		Commands = {"runcommandtest", "test"};	-- Commands
		Args = {"player"};	-- Command arguments
		Description = "test the RunCommand function";	-- Command Description
		Hidden = false; -- Is it hidden from the command list?
		Fun = false;	-- Is it fun?
		AdminLevel = "Moderators";	    -- Admin level; If using settings.CustomRanks set this to the custom rank name (eg. "Baristas")
		Function = function(plr,args)    -- Function to run for command
			for _, player in pairs(service.GetPlayers(plr,args[1])) do
				server.RunCommand('name',player.Name,'test')
			end
		end
	}
end

Maybe this? I am bad with scripts but I wanna try to help.

I’m pretty sure this came with the example script (which I modified with all of my custom commands) but just to make sure I tried changing/removing it but that didn’t fix anything.

What is this for? Group games?

And this weird “_”

Everything above the function itself came with the example module.

I guess just try modifying everything till it works. You won’t learn at all if you don’t break the script at some point.

Thats what I’ve been trying but whatever I do just refuses to work for some reason.
image
not even the line from the example itsef
image

update: I’ve been looking through more posts about the RunCommand function and I still wasn’t able to find the solution, it also seems like I’m the only one who gets an error like this
image

Try server.Admin.RunCommand
Sorry to answer just now, late.