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

TextButton MouseButton1Click not registering.

Frame > TextButton > script

Frame > Interface

That's the relevant hierarchy.

When I click the TextButton nothing happens. I haven't been able to figure out why so I'm asking the community. Any suggestions? Sorry, it's not much information.

script.Parent.MouseButton1Click:connect(function()
	script.Parent.Active = false
	for i = 3, 1, -1 do
		script.Parent.Text = ("Opening in " .. i)
		wait(1)
	end
	script.Parent.Text = "Opening interface."
	for i = 0, 1, .05 do
		if i >= script.Parent.BackgroundTransparency then
			script.Parent.BackgroudTransparency = i
		end
		if i >= script.Parent.TextTransparency then
			script.Parent.TextTransparency = i
		end
		wait(.05)
	end
	for i = 1, 0, .05 do
		script.Parent.Parent.Interface.TextTransparency = i
		if i >= .5 then
			script.Parent.Parent.Interface.BackgroundTransparency = i
		end
		wait(.05)
	end
end)

2 comments

0

Is the TextButton's Active property set to true?

0

It is.

1 answer

✓ Accepted answer

Line 10, you misspelled BackgroundTransparency.

7 comments

0

Thanks for catching that, but it's not getting that far.

0

Other than that, it worked fine for me.

0

It's within a surface GUI, if that helps.

0

Why do you need these if statements? if i >= script.Parent.BackgroundTransparency then

0

The Transparency value isn't set to 0 or 1.

0

Are both the TextTransparency and BackgroundTransparency the same on each? If so, you can do for i = script.Parent.BackgroundTransparency, 1, .05 do, then just remove the if statement.Even still though, it works for me, make sure the ZIndex is above everything else and It's set to Active.

0

No, they're not the same. I found the problem. "Interface" and the text button had the same Zindex so "Interface" covered it up. Thank's for your help though. :)

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