pasje1312
(pasje1312)
September 1, 2023, 7:05pm
#1
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
pasje1312
(pasje1312)
September 1, 2023, 7:12pm
#4
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?
Scottifly
(Scottifly)
September 1, 2023, 7:17pm
#6
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
pasje1312
(pasje1312)
September 1, 2023, 7:22pm
#7
I have to diffrent buttons and there both visible and then one goes invisible so you should see the change already with this script
pasje1312
(pasje1312)
September 1, 2023, 7:23pm
#8
does help idk why it would tho
Scottifly
(Scottifly)
September 1, 2023, 7:29pm
#9
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
pasje1312
(pasje1312)
September 1, 2023, 7:32pm
#10
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”
Scottifly
(Scottifly)
September 1, 2023, 7:39pm
#12
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..
Scottifly
(Scottifly)
September 1, 2023, 9:42pm
#14
Whoops, my bad. I just read through it too quickly. Original posts edited
1 Like