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

Why won't my textbutton do anything onclick? [SOLVED]

Asked by 4 years ago
Edited 4 years ago

**THANKS SO MUCH iiiAmericanLight FOR SOLVING THE QUESTION! ** So, I'm making a game, obviously, and I'm trying to make these imagelabels turn visible by the press of a button, but the button doesn't do anything. Before you ask, the imagelabels work perfectly if I manually turn them visible on Roblox studio, it's just I want it where, like I said, the button turns them visible. When I mean they work perfectly, I mean that they turn visible. The script:


local Cat = script.Parent.Parent.Cat local Cat2 = script.Parent.Parent.Cat2 local Cat3 = script.Parent.Parent.Cat3 local Cat4 = script.Parent.Parent.Cat4 local Cat5 = script.Parent.Parent.Cat5 script.Parent.MouseButton1Click:connect(function() script.Parent.Text = "Hi" Cat.Visible = false Cat2.Visible = true wait(0.2) Cat2.Visible = false Cat3.Visible = true wait(0.2) Cat4.Visible = true Cat3.Visible = false wait(0.2) Cat4.Visible = false Cat5.Visible = true wait(0.2) Cat5.Visible = false Cat4.Visible = true wait(0.1) Cat4.Visible = false Cat.Visible = true end)

Thank you!

0
Ensure this is a LocalScript Ziffixture 6913 — 4y
0
Is there a clickdetector on on the part? Dudez2Good4u 20 — 4y
0
And make sure that after script.Parent.MouseButton1Click there is a Connect with a capital C as connect is deprecated Echtic 128 — 4y
0
A ClickDetector's activation RBXScriptSignal is .MouseClick, this is a GuiObject, you cannot apply that Instance here @Dudez2Good4u Ziffixture 6913 — 4y
View all comments (3 more)
0
Hi guys, thank you for responding! Yes, it's a local script, and yes, it's a gui. PadmeOragana 78 — 4y
0
@iiiAmericanLight, thank you, that worked! Thanks everybody for responding! PadmeOragana 78 — 4y
0
Copy everything in the script Delete the script then put a local script in Ultim8creeper 15 — 4y

Answer this question