What do you want to achieve? I am cloning a booth to the player Backpack. Then the player can Equip it which places it on the map. When they approach the booth they can use a proximity prompt which moves the booth into workspace. Now they can type into the TextBox. I am trying to have the TextBox update to the PlayerGui so that what this player has typed onto the TextBox is visible to all players.
What is the issue? I know to do a Remote Event, and Currently the player can type into the TextBox and If I go look at the TextBox.Text property I can see the text that has been typed. However if I test with two players, the other player can’t see it. When I look at the players PlayerGui the Text field still has nothing in it.
What solutions have you tried so far? Did you look for solutions on the Developer Hub? I looked for examples here in the forums as well as online but nothing seems to fit my scenario precisely. I’ve been trying to get it to work writing this various different ways, but none have worked yet. I have remote events working in other different scripts, I just can not seem to get this one to work.
Server Script in SSS
local RS = game:GetService("ReplicatedStorage")
local editBoothRemote = RS.EditBooth
local Booth = game.Workspace:WaitForChild("Booth")
local SurfaceGui = Booth.TopSign.SurfaceGui
local Frame = SurfaceGui.Frame
local TBox = Frame.TextBox
local TextB = TBox.Text
editBoothRemote.OnServerEvent:Connect(function(Player, Text)
editBoothRemote:FireAllClients(Text)
end)
Local Script as child of TextBox
local RS = game:GetService("ReplicatedStorage")
local EditBooth = RS.EditBooth
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local Booth = game.Workspace:WaitForChild("Booth")
local SurfaceGui = Booth.TopSign.SurfaceGui
local Frame = SurfaceGui.Frame
local TBox = Frame.TextBox
local TextB = TBox.Text
local TextBox = script.Parent
EditBooth.OnClientEvent:Connect(function(player, text)
local playerGui = player:WaitForChild("PlayerGui")
local TextBox = playerGui.SurfaceGui.Frame.TextBox
local text = TextBox.Text
text = TextB
end)
currently you’re just storing the previous text as a variable and then updating that, which doesn’t do anything
to modify the property itself, modify the TextBox.Text property directly
local RS = game:GetService("ReplicatedStorage")
local EditBooth = RS.EditBooth
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local Booth = game.Workspace:WaitForChild("Booth")
local SurfaceGui = Booth.TopSign.SurfaceGui
local Frame = SurfaceGui.Frame
local TBox = Frame.TextBox
local TextBox = script.Parent
EditBooth.OnClientEvent:Connect(function(player, text)
local playerGui = player:WaitForChild("PlayerGui")
local TextBox = playerGui.SurfaceGui.Frame.TextBox
TextBox.Text = TBox.Text
end)
Ohh you are very correct on that, I’ve changed that however it is not updating to the Player Gui yet and not visible to another player. I believe I was thinking the text parameter should be used for how I had written it.
I entered the word play into the TextBox
You can see the text appear into the Surface Gui, TextBox for the booth as it sits in Workspace
It makes me think something is wrong with the way I’ve written the Fire Remote scripts, both the SSS and the Local Script ?
I have a Surface Gui sitting inside the Booth which is what is being typed into during live play. Then I need the Remote Event to update this to the Surface Gui that was in Starter Gui, but moved into Player Gui once the game is played. This way all players can see what someone types on the Booth.
I was thinking it might need something else like :
–TextBox:GetPropertyChangedSignal(“Text”):Connect(function()
–end)
but no matter which way I’ve written, I’m not getting the code to work.
I re wrote everything, lol, so the text is updating on the booth now but I’ve got a new issue. After I got one booth working I began setting up a second booth for another player. Now the second player is unable to update the text onto their booth. When they tried to write on their own booth it instead wrote to the other players booth. Even though I had written script to look at a string value stored in the booth with the player name on it and allow the text update for that specific booth. Ugghh.
I was then able to write code to block that player from updating anyone else’s booth but I still have not been able to get the second player that ability to update their own booth.
The string value on the booth is correct, it shows player one and player two on the two different booths. Yet the script matches player one to player two for player two when they try to write script to their own booth. It is as if the remote even fires and gets hung and stays on player one’s booth regardless. That is the best way I can describe what seems to be occurring. When i get a chance I will post my new scripting.