RP name script suddenly not working?

I’ve had this RP name and description script in my game for a long time now, and it never gave me any trouble up until recently, im not sure whats going on at all but now the names wont show up at all once typed in. theres no errors and i havent touched the script since i made it, considering it worked fine then?

any help on how to fix this would be very very appreciated, as i really dont know what could be going on with it.

Local script:

script.Parent.FocusLost:Connect(function()
	if script.Parent.Text ~= nil and script.Parent.Text ~= "" then
		game.ReplicatedStorage.RPNAME:FireServer("RPName", script.Parent.Text)
		game.ReplicatedStorage.RPNAME:FireServer("USERNAME", game.Players.LocalPlayer.Name)
	else
		game.ReplicatedStorage.RPNAME:FireServer("RPName", game.Players.LocalPlayer.DisplayName)
	end
end)

script.Parent.Changed:Connect(function()
	script.Parent.Text = script.Parent.Text:sub(1,25)
end)

Server script:

local text = game:GetService("TextService")
local Players = game:GetService("Players")

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
	if not Character.Head:FindFirstChild("Nametag") then
		repeat wait() until Character.Head ~= nil
			local nametag = game:GetService("ServerStorage").Descendants.Username:Clone()
			nametag.Parent = Character.Head
			nametag.Username.Text = Player.Name
		end
		Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
		Character.Humanoid.NameDisplayDistance = 0
	end)
end)

game.ReplicatedStorage.RPNAME.OnServerEvent:Connect(function(x)
		x.Character.Head.Username.Username.Visible = true
end)

Hello.
try this code:
LocalScript:

script.Parent.FocusLost:Connect(function()
	if script.Parent.Text ~= "" then
		game.ReplicatedStorage.RPNAME:FireServer(script.Parent.Text)
	else
		game.ReplicatedStorage.RPNAME:FireServer(game.Players.LocalPlayer.DisplayName)
	end
end)

script.Parent.Changed:Connect(function()
	script.Parent.Text = script.Parent.Text:sub(1,25)
end)

ServerScript:

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		if not Character.Head:FindFirstChild("Nametag") then
			local nametag = game:GetService("ServerStorage").Descendants.Username:Clone()
			nametag.Parent = Character.Head
			nametag.Username.Text = Player.DisplayName
			nametag.Username.Visible = true
		end
		Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
	end)
end)

game.ReplicatedStorage.RPNAME.OnServerEvent:Connect(function(x, str)
	if str ~= "" then
		x.Character.Head.Username.Username.Text = str
	else
		x.Character.Head.Username.Username.Text = x.DisplayName
	end
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.