I’m making a SurfaceGui that sits both in the server and inside of the client’s GUI.
But when I test the local server, it pops up for the client that wrote the text in the TextBox and the server but does NOT show any other client.
What am I doing incorrectly?
--ServerScript Snippet
local function updateText(player, middle)
script.Parent.SurfaceGui.Middle.Text = middle
print('fired function')
if player.Pink.Value == true then
script.Parent.SurfaceGui.Middle.TextColor3 = Color3.fromRGB(255, 152, 220)
elseif player.DarkBlue.Value == true then
script.Parent.SurfaceGui.Middle.TextColor3 = Color3.fromRGB(8, 24, 124)
elseif player.LightBlue.Value == true then
script.Parent.SurfaceGui.Middle.TextColor3 = Color3.fromRGB(29, 183, 248)
elseif player.Yellow.Value == true then
script.Parent.SurfaceGui.Middle.TextColor3 = Color3.fromRGB(255, 255, 0)
elseif player.Purple.Value == true then
script.Parent.SurfaceGui.Middle.TextColor3 = Color3.fromRGB(170, 0, 170)
elseif player.Green.Value == true then
script.Parent.SurfaceGui.Middle.TextColor3 = Color3.fromRGB(75, 151, 75)
elseif player.Black.Value == true then
script.Parent.SurfaceGui.Middle.TextColor3 = Color3.fromRGB(0,0,0)
end
ClientToServer:FireAllClients(script.Parent.SurfaceGui.Middle.Text)
end
RemoteEventMiddle.OnServerEvent:Connect(updateText)
--LocalScript Snippet
local function middleUpdate()
textBox.Middle:GetPropertyChangedSignal("Text"):Connect(function()
wait(waittime)
RemoteEvent:FireServer(textBox.Middle.Text)
if game.Players.LocalPlayer.Pink.Value == true then
script.Parent.Middle.TextColor3 = Color3.fromRGB(255, 152, 220)
elseif game.Players.LocalPlayer.DarkBlue.Value == true then
script.Parent.Middle.TextColor3 = Color3.fromRGB(8, 24, 124)
elseif game.Players.LocalPlayer.LightBlue.Value == true then
script.Parent.Middle.TextColor3 = Color3.fromRGB(29, 183, 248)
elseif game.Players.LocalPlayer.Yellow.Value == true then
script.Parent.Middle.TextColor3 = Color3.fromRGB(255, 255, 0)
elseif game.Players.LocalPlayer.Purple.Value == true then
script.Parent.Middle.TextColor3 = Color3.fromRGB(170, 0, 170)
elseif game.Players.LocalPlayer.Green.Value == true then
script.Parent.Middle.TextColor3 = Color3.fromRGB(75, 151, 75)
elseif game.Players.LocalPlayer.Black.Value == true then
script.Parent.Middle.TextColor3 = Color3.fromRGB(0,0,0)
end
end)
end
ClientToServer.OnClientEvent:Connect(function(text)
textBox.Middle.Text = text
end)