New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
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 6 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 468 — 6mo
no, its just the mouseubtton1click part 1swenzje 27 — 6mo

1 answer

Log in to vote
Answered by 6 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