Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with a "I agree" check box and "PLAY" button?

This is what I am making: https://gyazo.com/f12337d0ec3c446269a676178774ebe1

When I click on the check box for "I agree" and press play it goes away but when it is even unchecked, it goes away (I don't want that to happen if it is unchecked).

So what I want is if the check mark is visible then if I press "PLAY" I want it to go away.

script.Parent.MouseButton1Click:connect(function()
	if script.Parent.Check.Visible == false then
		script.Parent.Check.Visible = true
	else if script.Parent.Check.Visible == true then
		script.Parent.Check.Visible = false
		end
	end
	if script.Parent.Check.Visible == true then
		script.Parent.Parent.Play.MouseButton1Click:connect(function()
			script.Parent.Parent.Visible = false
		end)
	end
end)

1 answer

The only error I see here is in line 4 when you said else if, instead of elseif, or even else. See if this fixes your problem

script.Parent.MouseButton1Click:connect(function()
    if script.Parent.Check.Visible == false then
        script.Parent.Check.Visible = true
    else 
        script.Parent.Check.Visible = false
        end
    end
    if script.Parent.Check.Visible == true then
        script.Parent.Parent.Play.MouseButton1Click:connect(function()
            script.Parent.Parent.Visible = false
        end)
    end
end)

2 comments

0

Nope

0

can you provide a hiearchy of this gui?

This discussion is preserved as it was. New answers, comments, and votes are closed.