Hello! I’m aiming to create a system in which whatever the player types into the TextBox, is replicated for the ENTIRE server to see on a TextLabel inside a SurfaceGui. I’ve had a lot of trouble, and I’ve been trying many different methods, but to no avail. I’ve never wondered into these type of code, but I’m hoping you can help me out.
Here’s a ServerScript in ServerScriptService
local SetCinemaName = game.ReplicatedStorage.RemoteEvents.SetCinemaName
SetCinemaName.OnServerEvent:Connect(function(Player, Name)
local Filter = game:GetService("TextService"):FilterStringAsync(Player.UserId, Name)
local Check = Filter:GetNonChatStringForBroadcastAsync()
local PlotOwner = game.Workspace.GamePlots:GetDescendants("PlotOwner")
if PlotOwner.Value == Player.Name then
PlotOwner.Parent.Parent.Parent.CinemaName.SurfaceGui.CinemaName.Text = Check
end
end)
Here’s a client [LocalScript] inside the TextBox
local Confirm = script.Parent.Parent.CompleteButton
local Input = script.Parent
local Event = game.ReplicatedStorage.RemoteEvents.SetCinemaName
Confirm.MouseButton1Click:Connect(function()
local Name = Input.Text
if string.len(Name) > 1 or string.len > 20 then return end
Event:FireServer(Name)
print(Input.Text)
end)