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
You can get character through plr.Character
Optional, but you can/should make a var for the rank, ex:
local rank = chr.Head.Rank.Rank
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. ;/