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

Why won't this textbutton make another textbutton visible?

Asked by 4 years ago

Okay, so I'm working on a game and I'm trying to make this button make another button visible. It was working splendidly until I made the button that I want to turn visible bigger, and it broke for some reason. I tried making the button visible to make sure that you can see it, and you can, it's just the script that doesn't work anymore. It's a local script and no errors. Script:


local toggle = false script.Parent.MouseButton1Click:Connect(function() if toggle == false then toggle = true script.Parent.Parent.Parent.Frame.FeedTheTabby.Visible = true else toggle = false end end)

Thank you!

0
So wait. This is the code to make the other button appear visible? spot6003 64 — 4y
0
@spot, Hi thanks for replying, yes it is the code. PadmeOragana 78 — 4y
0
And the button is in startergui right? spot6003 64 — 4y
0
@spot, The button is in a frame in a starter gui in a startergui. PadmeOragana 78 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

Ok so, this is a common mistake that newer scripters make. I myself made this mistake when I first started. This script is editing the gui in StarterGui while what the player sees is located in the player folder in PlayerGui. You will need to use Remote Events to communicate with the server that the client pressed the button. The developer wiki has a good article on this found at this link: https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events. If after using remote events, it still doesnt work feel free to ask another question!

0
Hi, thank you for responding! That link is not available anymore, would you mind re-sending it or something? Thank you! PadmeOragana 78 — 4y
0
Try now, it should work. Sorry about that! spot6003 64 — 4y
0
Thank you so much! PadmeOragana 78 — 4y
Ad

Answer this question