Hi, I wanted to make a part where you type text in a gui, then goes on the part(Achieved)
The problem is when I type in the title, it changes for the description to(same for the game title)
I did try changing the scripts up a bit, but nothing is working.
Sorry if I’m being confusing.
Script under SurfaceGui:
--Server
local remoteEvent = game:GetService("ReplicatedStorage").EditMessage
game.Players.PlayerAdded:Connect(function(player)
local message = game.Chat:FilterStringForBroadcast(script.Parent.GameNameLabel.Text, player)
script.Parent.Parent.ClickDetector.MouseClick:Connect(function(player)
player.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = true
end)
end)
remoteEvent.OnServerEvent:Connect(function(player, message)
remoteEvent:FireAllClients(game:GetService("Chat"):FilterStringForBroadcast(message, player)) --Send our message back to all clients.
end)
game.Players.PlayerAdded:Connect(function(player)
local message = game.Chat:FilterStringForBroadcast(script.Parent.GameDescriptionLabel.Text, player)
script.Parent.Parent.ClickDetector.MouseClick:Connect(function(player)
player.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = true
end)
end)
remoteEvent.OnServerEvent:Connect(function(player, message)
remoteEvent:FireAllClients(game:GetService("Chat"):FilterStringForBroadcast(message, player)) --Send our message back to all clients.
end)
Script Under Frame:
--LocalScript
local remoteEvent = game:GetService("ReplicatedStorage").EditMessage
local EditButtonUi = game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditButton
script.Parent.DoneButton.MouseButton1Click:Connect(function()
remoteEvent:FireServer(script.Parent.GameName.Text)
game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = false
EditButtonUi.Visible = true
end)
remoteEvent.OnClientEvent:Connect(function(message)
workspace.Part.SurfaceGui.GameNameLabel.Text = message
end)
script.Parent.DoneButton.MouseButton1Click:Connect(function()
remoteEvent:FireServer(script.Parent.Description.Text)
game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = false
EditButtonUi.Visible = true
end)
remoteEvent.OnClientEvent:Connect(function(message)
workspace.Part.SurfaceGui.GameDescriptionLabel.Text = message
end)
Thank You.