I tried using the code from earlier to try and fix my problem, but it didn't work! Here are all the code snippets:
ServerScriptService script:
game.ReplicatedStorage.InfoInput.OnServerEvent:Connect(function(player) workspace.Board.SurfaceGui.Username.Text = player.PlayerGui.Gui.ScreenGui.Frame.Username.Text end)
TextButton [Local] script:
script.Parent.MouseButton1Click:Connect(function() print("Clicked!") local TextBox = game.StarterGui.ScreenGui.Frame.Username game.ReplicatedStorage.InfoInput:FireServer(TextBox.Text) end)
I have already asked someone for help and they said to make some changes to the TextButton script? I don't know if I'm being really dumb, or it just doesn't work.
This is for the ServerScriptService Script
--ServerScriptService Script game.ReplicatedStorage.InfoInput.OnServerEvent:Connect(function(player, text) --The "text" variable is the TextLabel's text that the LocalScript is passing, and change workspace.Board.SurfaceGui.Username.Text = text end)
This is for the LocalScript
--LocalScript local player = game.Players.LocalPlayers --Gets the player that the localscript is in script.Parent.MouseButton1Click:Connect(function() print("Clicked!") --Gets the TextBox from the player's gui local TextBox = player.PlayerGui.ScreenGui.Frame.Username --Sends the text to the Server via RemoteEvent game.ReplicatedStorage.InfoInput:FireServer(TextBox.Text) end)
The ServerScriptService script should say this:
game.ReplicatedStorage.InfoInput.OnServerEvent:Connect(function(player) workspace.Board.SurfaceGui.Username.Text =--Next line goes here game:GetService("StarterGui").Gui.ScreenGui.Frame.Username.Text end)
If there are any errors let me know!