Engine Issue or

Hello, the following script doesn’t seem to be work but no messages in output has been sent during testing, I’d like to know if some of you may help me. Many thanks.

local replicated = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local rank = replicated.Miscs:FindFirstChild("SpecialTitle")

players.CharacterAdded:Connect(function(player)
	local rankUI = rank:Clone()
	player.CharacterAdded:Connect(function(char)
		rankUI.Parent = player.Character:WaitForChild("Head")
	end)
	local securityMedicalRank = player:GetRankInGroup(9896154)
	local medicalRank = player:GetRankInGroup(6057034)

	rankUI.Frame.PlayerName.Text = player.Name

	if securityMedicalRank == 0 or securityMedicalRank == 1 then rankUI.Frame.PlayerRole.Text = "Visitor" return end
	if medicalRank == 0 or medicalRank == 1 then rankUI.Frame.PlayerRole.Text = "Visitor" return end

	if player.Team == "Security_Medical_Division" then
		if securityMedicalRank == 30 then
			rankUI.Frame.PlayerRole.Text = "SMD | Recruit"
			return
			-- Assign recruit
		elseif securityMedicalRank == 50 then
			rankUI.Frame.PlayerRole.Text = "SMD | Operative"
			return
			-- Assign Operative
		elseif securityMedicalRank == 99 then
			rankUI.Frame.PlayerRole.Text = "SMD | Officer"
			return
			-- Assign Officer
		elseif securityMedicalRank == 255 then
			rankUI.Frame.PlayerRole.Text = "SMD | Director"
			return
			-- Assign Director
		end
	elseif player.Team == "Medical_Personnel" then
		if medicalRank == 3 then
			rankUI.Frame.PlayerRole.Text = "MD | Probationary Doctor"
			return
			-- Assign Probationary Doctor
		elseif medicalRank == 4 then
			rankUI.Frame.PlayerRole.Text = "MD | Junior Doctor"
			return
			-- Assign Junior Doctor
		elseif medicalRank == 5 then
			rankUI.Frame.PlayerRole.Text = "MD | Intermediate Doctor"
			return
			-- Assign intermediate Doctor
		elseif medicalRank == 6 then
			rankUI.Frame.PlayerRole.Text = "MD | Senior Doctor"
			return
			-- Assign Senior Doctor
		elseif medicalRank == 7 then
			rankUI.Frame.PlayerRole.Text = "MD | Medical Operations Head"
			return
			-- Assign Medical Operations Head
		elseif medicalRank == 8 then
			rankUI.Frame.PlayerRole.Text = "MD | Secretary"
			return
			-- Assign Secretary
		elseif medicalRank == 9 then
			rankUI.Frame.PlayerRole.Text = "MD | Director"
			return
			-- Assign Director
		elseif medicalRank == 49 then
			rankUI.Frame.PlayerRole.Text = "MD | Overseer"
			return
			-- Assign Overseer
		end
	end
end)

First issue I spotted is that your using only one rankUI for each Character added why not place it within the CharacterAdded event. What your currently doing is reusing one rankUI for each player. Instead of just creating a new Clone each time player’s Character spawns. It uses same one over and over (not sure if it actually does it though like if it doesnt get deleted before it could be reused).

Your tip makes sense, but doesn’t seem to be the main solution of issue. Thanks for information.

It was just the start I felt it hard to further analyze the code when I was unsure how much of an impact that first issue was.

I just noticed…

Player.CharacterAdded In first event when it should be Players.PlayerAdded*

Wouldn’t your output log inform you of that error?

Is your script disabled? This is weird…

It’s supposed to, and no, my script is not disabled.