Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

TextButton MouseButton1Click not registering.

Asked by 10 years ago

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)
0
Is the TextButton's Active property set to true? Merely 2122 — 10y
0
It is. GoldenPhysics 474 — 10y

1 answer

Log in to vote
0
Answered by
Azarth 3141 Moderation Voter Community Moderator
10 years ago

Line 10, you misspelled BackgroundTransparency.

0
Thanks for catching that, but it's not getting that far. GoldenPhysics 474 — 10y
0
Other than that, it worked fine for me. Azarth 3141 — 10y
0
It's within a surface GUI, if that helps. GoldenPhysics 474 — 10y
0
Why do you need these if statements? if i >= script.Parent.BackgroundTransparency then Azarth 3141 — 10y
View all comments (3 more)
0
The Transparency value isn't set to 0 or 1. GoldenPhysics 474 — 10y
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. Azarth 3141 — 10y
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. :) GoldenPhysics 474 — 10y
Ad

Answer this question