Visible wont change!

I’ve been trying for hours to change the visibilty in a text button but it doesnt work info: its a local script every thing is located correctly and its a text button and it prints Z. and no errors

script:

print("Z")
script.Parent.MainFrame.ButtonInformationFrame.EquipButton.Visible = true
script.Parent.MainFrame.ButtonInformationFrame.UnequipButton.Visible = false
1 Like

Is there by chance there’s a server script that is changing the property of the GUI?

2 Likes

Everything seems to be happening at once, you see no change because the code does everything in order at the same time. It prints Z, immediately becomes visible, and instantly becomes invisible again. add a wait(3) or some other number between the lines of code so that each instruction happens three seconds apart.

1 Like

but its another button the equip and un equip

1 Like

I don’t understand what you’re trying to tell me, sorry. I do not know how to unequip a button, can you please elaborate?

The 3 lines of code you have are all being done almost instantly if they are in the same script as @sharker12312 said.

EDIT I misread the original script

I have to diffrent buttons and there both visible and then one goes invisible so you should see the change already with this script

does help idk why it would tho

Imaging a light switch.
You turn it on, wait 0.00005 seconds, then turn it off again. You won’t see it change.

Try this to make it make it visible for 5 seconds:

print("Z")
script.Parent.MainFrame.ButtonInformationFrame.EquipButton.Visible = true
task.wait(5)
script.Parent.MainFrame.ButtonInformationFrame.UnequipButton.Visible = false`

EDIT I misread the original script

hmm Ima try it tomarrow but,

I have an unequip button and an equip button qhen you press the equip button the equip button has to go invisible and the unequip to visible, and would you only want to have a light in for 5 secs

He means there is a button called “Equip” and a button called “Unequip”

I know, but when their lines of code fire (wherever it is) it’ll change Visible back and forth instantly.

EDIT I misread the original script

It’s not the same object, they are 2 different buttons, one of those buttons are being set true and another is being set to false.

it’s like saying this:

local button1 = script.ButtonOne
local button2 = script.ButtonTwo

button1.Visible = true
button2.Visible = false -- both different buttons..

Whoops, my bad. I just read through it too quickly. Original posts edited

1 Like