✓ Accepted answer
First of all, you really don't want to adjust the GUIs in the StarterGui, because that is a service that gives a copy of the GUI to the players' PlayerGui, therefore the change won't be visible right away.
What the code should be accessing is the players' PlayerGui, because that's where the players' real-time displayed GUIs are stored.
local GUI = game.Players.LocalPlayer.PlayerGui:WaitForChild("ScreenGui")
local button = GUI:WaitForChild("Help")
button.MouseButton1Click:connect(function()
game.Players.LocalPlayer.PlayerGui.Info.Information.Active= true
end)
local function clicked()
game.Players.LocalPlayer.PlayerGui.Info.TextBox.Visible=true
wait(10)
game.Players.LocalPlayer.PlayerGui.Info.TextBox.Visible=false
end
game.Players.LocalPlayer.PlayerGui.ScreenGui.TextButton.MouseButton1Click:connect(clicked)
If your script is within one of the GUIs, then I recommend referring your GUI objects starting from the script (such as script.Parent).
EXAMPLE
Let's assume your script is within ScreenGui. You don't necessarily have to have a LocalScript this way. You could use script.Parent.Parent.Info to access the Info GUI.
local GUI = script.Parent
local button = GUI:WaitForChild("Help")
local InfoGui = GUI.Parent:WaitForChild("Info")
button.MouseButton1Click:connect(function()
InfoGui.Information.Active= true
end)
local GUI = script.Parent
local TB = GUI:WaitForChild("TextButton")
local InfoGui = GUI.Parent:WaitForChild("Info")
local function clicked()
InfoGui.TextBox.Visible=true
wait(10)
InfoGui.TextBox.Visible=false
end
TB.MouseButton1Click:connect(clicked)
1 comment
If it's not a TextButton change it to what it is.