local textButton = script.Parent
repeat
wait(2)
if script.parent.parent.AspectSelection.Text == '' then
if script.parent.parent.ClassSelection.Text == '' then
script.parent.Text = 'Please select a class and aspect'
else
script.parent.Text = 'Please select an aspect'
end
elseif script.parent.parent.ClassSelection.Text == '' then
script.parent.Text = 'Please select a class'
else
script.parent.Text = '>Enter'
textButton.Active = true
end
until 1 == 0
script.Parent.MouseButton1Click:connect(function()
script.Parent.Parent.Enabled = false
end)
I'm trying to make a button that stays inactive until you meet certain requirements (clicking two other buttons essentially). I've managed to get it to detect whether or not the requirements have been fulfilled, but i can't get it to actually reactivate the button.
Altered code based on NickAtNick's response
local textButton = script.Parent
local bool = true
repeat
wait(2)
if script.parent.parent.AspectSelection.Text == '' then
if script.parent.parent.ClassSelection.Text == '' then
script.parent.Text = 'Please select a class and aspect'
script.Parent.Activated:Connect(function()
bool = not bool -- toggle
end)
else
script.parent.Text = 'Please select an aspect'
script.Parent.Activated:Connect(function()
bool = not bool -- toggle
end)
end
elseif script.parent.parent.ClassSelection.Text == '' then
script.parent.Text = 'Please select a class'
script.Parent.Activated:Connect(function()
bool = not bool -- toggle
end)
else
script.Parent.Activated:Connect(function()
bool = bool -- toggle
end)
script.parent.Text = '>Enter'
end
until 1 == 0
script.Parent.MouseButton1Click:connect(function()
script.Parent.Parent.Enabled = false
end)
script.Parent.MouseButton1Click:connect(function()
script.Parent.Parent.Enabled = false
end)

6 comments
I don't think i'm quite getting it yet. I've added the new code to my original post.
seemed someone edited my answer.... but can you actually make a gif or an album of what u are really trying to do?? or screenshot your startergui in explorer! thanks if possible!
I've added a link to an album with both a screenshot of explorer and some screenshots of the actual ui illustrating what i'm trying to do
oh, so it seemed you have the ClickEvent in different scripts.
You are using ServerScripts, you should use LocalScript instead!
I replaced the serverscript with a localscript, but it still doesn't seem to be working.