Roleplay Name text from Billboard GUI not changing

Hello, I created a script that tries to change the text on a Billboard GUI that is used as the Roleplay Name, currently the text just says “Label” instead of the players username, additionally when trying to use the button to confirm a new Roleplay Name nothing happens. Any help on how to fix this? I’ve attached images of my naming conventions and code below.

image
image
image
image

Script that clones the BillboardGUI:
local NametagEvent = game:GetService(“ReplicatedStorage”).NameTag
local Nametag = game.ServerStorage:WaitForChild(“RoleName”)

game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(Char)
local TagClone = Nametag:Clone()
if Char:FindFirstChild(“Head”) then
TagClone.Parent = Char.Head
end
end)

end)

NametagEvent.OnServerEvent:Connect(function(plr,Text)
print(plr,“wrote”,Text)
plr.Character.Head.TextName.TextLabel.Text = Text
end)

Script for the TextBox of the GUI:
script.Parent.MouseButton1Click:Connect(function()
local Text = script.Parent.NameInput.Text
game:GetService(“ReplicatedStorage”).NameTag:FireServer(Text)
end)

If your file structure is the same, your LocalScript is not referencing the textbox properly, you should be getting an error in the output/console.

script.Parent.Frame.NameInput.Text

That is what you should send as the Text in the LocalScript.

Hi thanks for the help, I changed what you mentioned and the output window says there is something wrong here:
image

Its not referencing the button. This should be following the correct path:

script.Parent.Frame.ConfirmButton.MouseButton1Click:Connect(function()
end)

Make sure you keep the BillboardGui inside of the StarterGui Service and just change the adornee to the head of the player.

I got it to work, however it doesn’t use the chat filter so how can I connect the chat filter to it?
image
image

Run a serverScript that uses a remoteEvent.
Example:

checkJob.OnServerEvent:Connect(function(player, titleText, DescText)
	local filterTextTitle = textService:FilterStringAsync(tostring(titleText), player.UserId)
	local filterDescText = textService:FilterStringAsync(tostring(DescText), player.UserId)
	
	local filt1 = filterTextTitle:GetNonChatStringForBroadcastAsync()
	local filt2 = filterDescText:GetNonChatStringForBroadcastAsync()
	
	checkJob:FireClient(player, filt1, filt2)
end)

This is an example of how I have used it.

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