As I usually do, my title doesn't say much but here it is:
So I have a Surface Gui with a TextButton, once clicked it opens up a ScreenGui named 'ComputerGui' for the player that clicked it with a TextBox to type on.
It should automatically update the text of the TextButton on the SurfaceGui until the ScreenGui is closed.
The only issue is that the text isn't changing, here's the script: (The script is in the TextButton which is necessary for what I'm making)
local computerGui = script.Parent.ComputerGui
computerGui.Parent = script.Parent
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
script.Parent.MouseButton1Click:Connect(function()
local copy = computerGui:Clone()
copy.Parent = computerGui.Parent
copy.AncestryChanged:Connect(function(child, parent)
print(child.Name.." is now a child of "..parent.Name)
end)
copy.Parent = plr.PlayerGui
end)
end)
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.Character:Connect(function(char)
if plr.PlayerGui:FindFirstChild("ComputerGui")
then
repeat
script.Parent.Text = plr.PlayerGui.Computer.Notepad.TextButton.Text
until not plr.PlayerGui:FindFirstChild("ComputerGui")
end
end)
end)
Feel free to ask questions for more clearance.

1 comment
I am not sure if I understand, also the GUI self-destruct once closed.