Basic Admin Plugin Command Help

I am trying to make a :rank command. That changes the players rank UI with a certain command, I know how to do it with the Basic admin :s command and the Developer console But I don’t want to type all that code out as It takes a while.
This is the DeV Console Code I use and Have been trying to use For the basic admin plugin script is.

game.Workspace.IdealJordan.Head.Rank.Frame.TextLabel.Text = ' '

I am just having trouble with the Arguments for Player and Text.

https://gyazo.com/b834da83ba3af75c5506606bb1a0b338

Like that or did I do the Id part wrong?

You can keep the ID as game.CreatorId unless it’s a group game.

https://gyazo.com/4e3f1b2123c3bc02d1692ec8cf9df25a

Its still not working I may be doing something wrong I am not sure.

Are there any errors in the output?

No there are not any errors in the output.

Here’s some updated code; looks like something isn’t working on line 16:

local prefix = ":"
local Players = game:GetService("Players")
local TextService = game:GetService("TextService")
local adminId = 1197680948
local function onPlayerAdded(player)
	local character = player.Character or player.CharacterAdded:Wait()
	player.Chatted:Connect(function(msg)
		local split = msg:split(" ")
		if player.UserId == adminId and split[1]:lower() == prefix.."rank" then
			local playerName = split[2]
			local rank = split[3]
			if playerName and rank then
				local playerInstance = Players:FindFirstChild(playerName)
				if playerInstance then
					local playerCharacter = playerInstance.Character or playerInstance.CharacterAdded:Wait()
					playerCharacter:WaitForChild("Head"):WaitForChild("Rank"):WaitForChild("Frame"):WaitForChild("TextLabel").Text = TextService:FilterStringAsync(rank, player.UserId):GetNonChatStringForBroadcastAsync() --doesnt seem to be working
				end
			end
		end
	end)
end
Players.PlayerAdded:Connect(onPlayerAdded)
for k, v in ipairs(Players:GetPlayers()) do
	onPlayerAdded(v)
end
1 Like

Alright thank you for the help I will keep looking for some more reply’s and I will try to fix Line 16.

I forgot to mention that you need to change the adminId variable to your UserId.