What do you want to achieve? For the TextButton to disappear when clicked.
What is the issue? It does not disappear, the code does not work as intended.
What solutions have you tried so far? Did some troubleshooting and suspecting there’s an issue with detecting the click or possible with the before statements of Button.Visiblity = true.
Here’s the whole code:
local TextLabel = script.Parent:WaitForChild("Frame"):WaitForChild("TextLabel")
local napp1 = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.nappula1
local napp2 = script.Parent.Frame.nappula2
local napp3 = script.Parent.Frame.nappula3
local napp4 = script.Parent.Frame.nappula4
wait(4)
local function typewrite(object,text)
for i = 1,#text,1 do
object.Text = string.sub(text,1,i)
wait(0.04)
end
end
typewrite(TextLabel,"You have been chosen to parttake in this quiz - your future will be decided here.")
wait (4)
typewrite(TextLabel,"The first question:")
wait (3.5)
typewrite(TextLabel,"If you pick an answer to this question at random, what is the chance that you will be correct?")
wait (1)
script.Parent.Frame.nappula1.Visible = true
script.Parent.Frame.nappula2.Visible = true
script.Parent.Frame.nappula3.Visible = true
script.Parent.Frame.nappula4.Visible = true
game.StarterGui.ScreenGui.Frame.nappula1.Activated:Connect(function() -- Problem Part
napp1.Visible = false
end)
local TextLabel = script.Parent:WaitForChild("Frame"):WaitForChild("TextLabel")
local napp1 = script.Parent:WaitForChild("Frame"):WaitForChild("nappula1")
local napp2 = script.Parent:WaitForChild("Frame"):WaitForChild("nappula2")
local napp3 = script.Parent:WaitForChild("Frame"):WaitForChild("nappula3")
local napp4 = script.Parent:WaitForChild("Frame"):WaitForChild("nappula4")
task.wait(4)
local function typewrite(object,text)
for i = 1,#text,1 do
object.Text = string.sub(text,1,i)
task.wait()
end
end
typewrite(TextLabel,"You have been chosen to parttake in this quiz - your future will be decided here.")
task.wait(6)
typewrite(TextLabel,"The first question:")
task.wait(3)
typewrite(TextLabel,"If you pick an answer to this question at random, what is the chance that you will be correct?")
task.wait(6)
napp1.Visible = true
napp2.Visible = true
napp3.Visible = true
napp4.Visible = true
napp1.Activated:Connect(function() -- Problem Part
napp1.Visible = false
end)
You don’t need to reference “PlayerGui” when manipulating UI in the StarterGui, providing the local script is located inside the “StarterGui” folder the above script will work. Just make sure it’s placed correctly.