I wanted to make a script that when a button is clicked in the GUI, the Text on the GUI screen disappears. But the script didn't work. Here is the script
local textButton = script.Parent
local function Test()
game.StarterGui.ScreenGui.TextLabel.TextTransparency = 1
end
game.Workspace.block.SurfaceGui.TextButton.MouseButton1Click:Connect(Test)
Can you tell me how to fix it?

1 comment
When the game starts, all the GUI gets copied from the StarerGui into PlayerGui, so you'd have to do game.Players.LocalPlayer.PlayerGui instead of game.StarterGui!