- 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
to the server and show the text on the projector screen so everyone is able to see the things I wrote
- 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
- 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.
-- 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)