I have the name and group ranks working but when I tried making a Level It wouldn't show up does anyone know what I've done wrong its probably really clear and I've missed it.

local rs = game:GetService("ReplicatedStorage")
local remotefolder = rs:WaitForChild("RankFolder")
local remote = remotefolder:WaitForChild("RankPlayerOnRespawn")

remote.OnServerEvent:connect(function(Player)
	if not Player then
		print("an error occured fetching the player")
	end
	local pRank = Player:GetRoleInGroup(6004568)
	wait(1)
	local ui = script.Rank:Clone()
	ui.Parent = Player.Character
	ui.Adornee = Player.Character.Head
	
	while not Player.Character.Humanoid do wait() end
	Player.Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
	local frame = ui.Frame
	local name = frame.Name1
	local role = frame.TextLabel
	local Lvl = frame.Lvl
	
	
	Lvl.Text = "Text"
	name.Text = Player.Name
	role.Text = pRank
	
	if name.Text == "" then
		name.TextStrokeTransparency = 0
		name.TextStrokeColor3 = Color3.new(0, 0, 0)
		role.TextStrokeTransparency = 0
		role.TextStrokeColor3 = Color3.new(0, 255, 0)
		Lvl.TextStrokeTransparency = 0
		Lvl.TextStrokeTransparency = Color3.new(0, 0, 0)
		role.Text = ""
		Lvl.Text = "TEST"
	
	elseif name.Text == "Bxl0c" then
	name.TextStrokeTransparency = 0
	name.TextStrokeColor3 = Color3.new(0, 0, 0)
	role.TextStrokeTransparency = 0
	name.TextStrokeColor3 = Color3.new(200, 0 , 0)
	while wait(.5) do
	game.Workspace.Bxl0c.Rank.Frame.Name1.TextStrokeColor3 = Color3.fromHSV((math.random(0,36)*10)/360,1,1)
	
    
end
end
end)