In my button script, I have
script.Parent.Parent.Parent.Parent.Enabled = false
and its hiding the BUTTON, not the ScreenGui
Full script:
script.Parent.MouseButton1Click:Connect(function()
if script.Parent:WaitForChild('haveToBuy').Value == true then return
else
game.ReplicatedStorage.Tool:FireServer(script.Parent.Parent.Number.Value)
script.Parent.Parent.Parent.Parent.Enabled = false
end
end)
TDtheTV
(TDtheTV)
January 27, 2021, 6:13pm
#2
If the button is a child of the ScreenGui, maybe you are accidentally calling it. Try adding another .Parent
Tom_atoes
(Tom_atoes)
January 27, 2021, 6:15pm
#3
Show us your explorer, we can’t help you if you haven’t provided any information.
1 Like
Its in 2 frames and 1 ScreenGui
Tix1511
(Tix1511)
January 27, 2021, 6:20pm
#5
Are you sure you parented your other GUI elements to the same ScreenGui object? The button itself doesn’t have a property called “Enabled”, so it should really be printing out an error if you are referencing the wrong object. Any console output?
1 Like
It has to be disabling the ScreenGui because buttons don’t have an Enabled
property.
This is a little vague, can you maybe do something like this:
ScreenGui
Frame
Frame
-- and so on
It has to be disabling the ScreenGui because buttons don’t have an Enabled
property.
Ikr
This is a little vague, can you maybe do something like this:
ScreenGui
Frame
Frame
Button
And no errors or warnings that’s what’s so weird.
The script is correct, did you check what the ScreenGui’s Enabled property is in the explorer during a play test?
Check it in PlayerGui
Players
[Your Name]
PlayerGui
ScreenGui
Tix1511
(Tix1511)
January 27, 2021, 6:25pm
#9
Just to make this easier for us, could you send a place file?
Check it in PlayerGui
I did
The script is correct, did you check what the ScreenGui’s Enabled property is in the explorer during a play test?
It stays disabled it starts out disabled
Tix1511
(Tix1511)
January 27, 2021, 6:35pm
#11
Please provide a place file or at least show us a screenshot of your UI.
I figured it out, it is a copy of another gui that was under it and it hid it but showed the one with the button no visible