How do I update text for the hole server

Hello developers,

I need some help with making text update with the hole server. What I am doing is filtering text and updating a text lable to the filter text. I’m using a script to filter the text and update it. The error I’m getting is the text is not updating.

Scripts

-- Script
game:GetService("ReplicatedStorage").RemoteEvent.OnServerEvent:Connect(function(plr, txt)
	local filteredString = game:GetService("Chat"):FilterStringForBroadcast(txt, plr)
	game.StarterGui.ScreenGui.TextBox.Text = filteredString -- This should update the text
	print(filteredString)
end)
-- Local Script
local textbox = script.Parent.TextBox
textbox.FocusLost:Connect(function(enterPressed)
	if not enterPressed then
		return
	else
		game:GetService("ReplicatedStorage").RemoteEvent:FireServer(textbox.Text)
	end
end)

You are updating the StarterGui’s textbox.

Each player has their own PlayerGui which creates a clone of the current version of the StarterGui. If you want to update every player’s gui, you should be handling this on the client.

Maybe store a value of what the text should be saying in ReplicatedStorage, and detect when it’s changed - when it is, update the textlabel.

i.e.:

Server:

ReplicatedStorage.LabelText.Value = "Whatever you want it to be."

Client:

local LabelText = game.ReplicatedStorage.LabelText
local Player = game.Players.LocalPlayer
local PlayerGui = Player:WaitForChild"PlayerGui"
LabelText:GetPropertyChangedSignal"Value":Connect(function()
    local NewValue = LabelText.Value
    PlayerGui.Label.Text = NewValue
end)