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

Triggering before it has even fired?

Basically, I have a TextButton which when clicked, I want a certain thing (called 'display' in this case) to become visible, however it triggers when I join the game and don't even click the button. I had to create a IntValue so I could find the part I am trying to make Visible, as the TextButton's parent changes. Any help to resolving this is appreciated.

y = Instance.new("IntValue")
y.Parent = script.Parent
wait(.1)
h = script.Parent.TextButton5:Clone()
h.Parent = script.Parent.Screen


h.MouseButton1Down:connect(function()
y.Parent.Parent.display.Transparency = 0
y.Parent.Parent.display.Decal.Transparency = 0
end)

2 comments

0

To debug, try setting the transparency to 1 within the script -- preferably as far towards the top as possible.

0

Sorry. Doesn't work.

1 answer

MouseButton1Click is not a variable/boolean value, it's an event that fires when you fully click the textbutton. Is "h" equal to a textbutton or what? If it isn't then direct it to the button.

h.MouseButton1Down:connect(function()
y.Parent.Parent.display.Transparency = 0
y.Parent.Parent.display.Decal.Transparency = 0
end)

The stuff you do with the intvalue looks very weird and unnecessary.

4 comments

0

This does not work sadly. The IntValue is basically just a point which I use to find the certain thing I want to make invisible.

0

visible*

0

Are you sure that they are not already visible???

0

No, they are definitely invisible.

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