Still have questions? Join our Discord server and get real time help.
Log in to vote

Why isn't my toggle GUI button script working with imagelabels but works with everything else?

Asked by 3 months ago

when i try to script a "toggle gui" button that is supposed to toggle an image label when pressed, it doesnt work. when i tried using an image button it worked so why isn't the script working with imagelabels?

my script:

    game.StarterGui.Frames.Backpack.Visible = true

my workspace:

Is that all of your code? popeeyy 448 — 3mo
no, its just the mouseubtton1click part 1swenzje 27 — 3mo

1 answer

Log in to vote
Answered by
incapaxx 3252 Badge of Merit Moderation Voter Community Moderator
3 months ago

Because ImageButtons are buttons. They are able to be interacted with and they can show a picture whereas an ImageLabel is just to show a picture. In addition, the StarterGui is not where the player's Gui is, it is in their PlayerGui.

local client = game:GetService("Players").LocalPlayer

    client.PlayerGui.Frames.Backpack.Visible = true

I gave an explanation on the difference which you are able to find here


Answer this question