local Players = game:GetService("Players")
local player = Players.LocalPlayer
local EditButtonUi = player.PlayerGui:WaitForChild("EditingUi").EditButton
local EditGui = player.PlayerGui:WaitForChild("EditingUi").EditGui
EditButtonUi.MouseButton1Click:Connect(function()
EditGui.Visible = true
EditButtonUi.Visible = false
end)
You need to fire your message to the server with a RemoteEvent, have the server filter the message, and then have the server :FireAllClients(filteredMessage) and have the clients display the message that was filtered.
--Server
local remoteEvent = game:GetService("ReplicatedStorage").EditMessage
game.Players.PlayerAdded:Connect(function(player)
local message = game.Chat:FilterStringForBroadcast(script.Parent.GameNameLabel.Text, player)
script.Parent.Parent.ClickDetector.MouseClick:Connect(function(player)
player.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = true
end)
end)
game.Players.PlayerAdded:Connect(function(player)
local message = game.Chat:FilterStringForBroadcast(script.Parent.GameDescriptionLabel.Text, player)
script.Parent.Parent.ClickDetector.MouseClick:Connect(function(player)
player.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = true
end)
end)
remoteEvent.OnServerEvent:Connect(function(player, message)
remoteEvent:FireAllClients(game:GetService("Chat"):FilterStringForBroadcast(message, player)) --Send our message back to all clients.
end
Since client changes are only seen on the client, On the client you need to get the text and fire it through a remote event to the server. The server picks it up and updates the text.