Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What's wrong with my code that makes a GUI appear?

Asked by 9 years ago

The script is in a ScreenGui in the player's PlayerGui. ViewPhotos is a TextButton within a Frame(called Frame) that is a child of the ScreenGui. Nothing relevant comes in output and there are no noted errors in the code.

If any more info is needed, please ask!!

button = script.Parent.Main.ViewPhotos

button.MouseButton1Click:connect(function()
script.Parent.Main.ViewPhotos.MouseButton1Up:connect(function(player)
    pcall(function()
        if player.PlayerGui.Desk.ImageLabel.Visible == false then
            player.PlayerGui.Desk.ImageLabel.Visible = true
        else
            player.PlayerGui.Desk.ImageLabel.Visible = false
        end
    end)
end)
end)

1 answer

Log in to vote
0
Answered by 9 years ago

hope this works~

button = script.Parent.Main.ViewPhotos

button.MouseButton1Up:connect (function()
         script.Parent.Desk.ImageLabel.Visible = not  script.Parent.Desk.ImageLabel.Visible
end)
Ad

Answer this question