Still have questions? Join our Discord server and get real time help.
0

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

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:

button.MouseButton1Click:Connect(function()
game.StarterGui.Frames.Backpack.Visible = true


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

0
incapaxx 3252
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

button.Activated:Connect(function()
client.PlayerGui.Frames.Backpack.Visible = true
end)


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