Why Is it Showing For Both Text Labels?

  1. What do you want to achieve? Keep it simple and clear!
    Want to make a stand(part) where you can edit for others to see.

  2. What is the issue? Include screenshots / videos if possible!
    For some reason it wont shop up for only there’s, it will show for the other stand too
    robloxapp-20210831-1955311.wmv (1.1 MB)
    .

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I did try many thing like youtube, devforum, and the devhub

--part1
local remoteEvent = game:GetService("ReplicatedStorage").EditMessage
local EditButtonUi = game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditButton

script.Parent.Parent.DoneButton.MouseButton1Click:Connect(function()
	remoteEvent:FireServer("name1", script.Parent.Parent.GameName.Text)
	remoteEvent:FireServer("description1", script.Parent.Parent.Description.Text)
	game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = false
	EditButtonUi.Visible = true
end)

remoteEvent.OnClientEvent:Connect(function(type_, message)
	if type_ == "name1" then
		workspace.MainParts.Main1.SurfaceGui.GameNameLabel.Text = message
	elseif type_ == "description1"then
		workspace.MainParts.Main1.SurfaceGui.GameDescriptionLabel.Text = message
	end
end)
--part2
local remoteEvent = game:GetService("ReplicatedStorage").EditMessage
local EditButtonUi = game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditButton

script.Parent.Parent.DoneButton.MouseButton1Click:Connect(function()
	remoteEvent:FireServer("name2", script.Parent.Parent.GameName.Text)
	remoteEvent:FireServer("description2", script.Parent.Parent.Description.Text)
	game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = false
	EditButtonUi.Visible = true
end)

remoteEvent.OnClientEvent:Connect(function(type_, message)
	if type_ == "name2" then
		workspace.MainParts.Main2.SurfaceGui.GameNameLabel.Text = message
	elseif type_ == "description2" then
		workspace.MainParts.Main2.SurfaceGui.GameDescriptionLabel.Text = message
	end
end)
--Server
local remoteEvent = game:GetService("ReplicatedStorage").EditMessage

game.Players.PlayerAdded:Connect(function(player)
	script.Parent.Parent.ClickDetector.MouseClick:Connect(function(player)
		player.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = true
	end)
end)

remoteEvent.OnServerEvent:Connect(function(player, type_, message)
	remoteEvent:FireAllClients(type_, game:GetService("Chat"):FilterStringForBroadcast(message, player)) --Send our message back to all clients.
end)

Help is very needed, as I have no one else to help, thank you!

3 Likes

In part 2, in line 10, when you use OnClientEvent(type_, message)
When you gonna say text label.Text = message.
Then it gonna be the same together. Try to fire another text label with another remote event. You fired 2 text labels with 1 remote event so texts are gonna be the same.

game.ReplicatedStorage.EditMessage.OnClientEvent:Connect(function(type_, message)

if type_ == "name1" then
	workspace.MainParts.Main1.SurfaceGui.GameNameLabel.Text = message
	
elseif type_ == "name2" then
	workspace.MainParts.Main2.SurfaceGui.GameNameLabel.Text = message
	
end

end)

game.ReplicatedStorage.EditMessage2.OnClientEvent:Connect(function(type_, message)

if type_ == "description1" then
	workspace.MainParts.Main1.SurfaceGui.GameDescriptionLabel.Text = message
	
elseif type_ == "description2" then
	workspace.MainParts.Main1.SurfaceGui.GameDescriptionLabel.Text = message
	
end

end)

Or

game.ReplicatedStorage.EditMessage.OnClientEvent:Connect(function(type_, message)

if type_ == "name1" then
	workspace.MainParts.Main1.SurfaceGui.GameNameLabel.Text = message
	
elseif type_ == "name2" then
	workspace.MainParts.Main2.SurfaceGui.GameNameLabel.Text = message

elseif type_ == "description1" then
	workspace.MainParts.Main1.SurfaceGui.GameDescriptionLabel.Text = message
	
elseif type_ == "description2" then
	workspace.MainParts.Main1.SurfaceGui.GameDescriptionLabel.Text = message
	
end

end)

I tried this But it does the same thing, ill show you my whole script

--part1
local EditMessageEvent = game:GetService("ReplicatedStorage").EditMessage
local EditButtonUi = game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditButton

local function labels()
	EditMessageEvent:FireServer("name1", script.Parent.Parent.GameName.Text)
	EditMessageEvent:FireServer("description1", script.Parent.Parent.Description.Text)
	EditMessageEvent:FireServer("name2", script.Parent.Parent.GameName.Text)
	EditMessageEvent:FireServer("description2", script.Parent.Parent.Description.Text)
end

script.Parent.Parent.DoneButton.MouseButton1Click:Connect(function()
	labels()
	game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = false
	EditButtonUi.Visible = true
end)

EditMessageEvent.OnClientEvent:Connect(function(type_, message)
	if type_ == "name1" then
		workspace.MainParts.Main1.SurfaceGui.GameNameLabel.Text = message

	elseif type_ == "name2" then
		workspace.MainParts.Main2.SurfaceGui.GameNameLabel.Text = message

	elseif type_ == "description1" then
		workspace.MainParts.Main1.SurfaceGui.GameDescriptionLabel.Text = message

	elseif type_ == "description2" then
		workspace.MainParts.Main2.SurfaceGui.GameDescriptionLabel.Text = message

	end
end)

1 Like

can u screen shot your workspace - SurfaceGui located

1 Like

image

Inside the surface uis is the server script and labels.

1 Like

I made another remote event but still it doesnt work, it like part but with a different remote event.

1 Like