Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Custom adonis command not working. No error output. Why is it happening?

Hi. I'm making a setrank command for my game but the command isn't working. Anybody know why this is happening? There's no output in console. Here is my script:

server = nil
service = nil
return function()
	server.Commands.ExampleCommand = {
		Prefix = '!';
		Commands = {"setrank", "setgroup", "settag"};
		Args = {"arg1"};
		Description = "Set group tag.";
		Hidden = false;
		Fun = false;
		AdminLevel = "Players";
		Function = function(plr,args)
			local plrName = plr.Name
			local chr = game.Workspace[plrName]
			local secId = 11597600
			local mainId = 11597498
			local adminId = 11597658
			
			if tostring(args[1]) == 'rt' or 'main' then
				chr.Head.Rank.Rank.Text = plr:GetRoleInGroup(mainId)
			elseif tostring(args[1]) == 'security' or 'RTST' then
				chr.Head.Rank.Rank.Text = plr:GetRoleInGroup(secId)
			elseif tostring(args[1]) == 'ad' or 'administration' then
				chr.Head.Rank.Rank.Text = plr:GetRoleInGroup(adminId)
			end
		end
	}
end

1 answer

  1. You can get character through plr.Character

  2. Optional, but you can/should make a var for the rank, ex:

local rank = chr.Head.Rank.Rank
  1. I'm not sure if this is intentional or not but it might be
chr.Head.Rank.Text
--instead of
chr.Head.Rank.Rank.Text

If 3 doesn't help then add me on discord: Shiba#5586 and I can help more

P.S. In the answer section I wrote 3. but it shows up as 1. ;/

1 comment

0

Resolved in dms, was parenting to head incorrectly.

This discussion is preserved as it was. New answers, comments, and votes are closed.