Projector screen not working

  1. What do you want to achieve? Keep it simple and clear!

Hello, I want to make like I only have access to a textbox and able to show the things I wrote to the server on a projector screen so everyone can see it!

Example

I’m the creator of the game I’m the only one who has access to the textbox and when I write something it sends that information
image

to the server and show the text on the projector screen so everyone is able to see the things I wrote
image

  1. What is the issue? Include screenshots / videos if possible!

the issue is that when I type something in the textbox it won’t show the text to the server and there is no error in the output

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I did research on google and devforum but could not find a solution for it.

image

-- LocalScript
local textbox = script.Parent.TextBox
local RS = game:GetService("ReplicatedStorage")
local ShowText = RS:WaitForChild("ShowText")

textbox:GetAttributeChangedSignal("Text"):Connect(function()
	ShowText:FireServer(textbox.Text)
end)
-- ServerScript
local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local ShowText = RS:WaitForChild("ShowText")

ShowText.OnServerEvent:Connect(function(player, text)
	for _,player in pairs(Players:GetPlayers()) do
		local textlabel = player.PlayerGui.SurfaceGui:WaitForChild("TextLabel")
		local textbox = player.PlayerGui.ScreenGui:WaitForChild("TextBox")
		textbox.Text = text
	end
end)
1 Like

In the server script, you don’t need to loop through all of the players you just set the text once.

1 Like

Also you need to filter the text. Otherwise, your game will get out under review, then deleted.

1 Like

How would I filter out the text?

You can put the SurfaceGui in the workspace inside the part and then just change it to the text that the player entered in the textbox with a remote event. I also believe that the text is a property, not an attribute.

Also, to filter the text, you can do something like this:

local TextService = game:GetService("TextService")
local Text = "hello"
local success, result = pcall(function()
	return TextService:FilterStringAsync(Text, player.UserId)
end)

if success then
	local filteredtext = result:GetNonChatStringForBroadcastAsync()
	print(filteredtext) --> hello
end 
1 Like