Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

Why won't this textbutton make another textbutton visible?

Asked by 4 months 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 — 4mo
0
@spot, Hi thanks for replying, yes it is the code. PadmeOragana 41 — 4mo
0
And the button is in startergui right? spot6003 64 — 4mo
0
@spot, The button is in a frame in a starter gui in a startergui. PadmeOragana 41 — 4mo

1 answer

Log in to vote
1
Answered by 4 months 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 41 — 4mo
0
Try now, it should work. Sorry about that! spot6003 64 — 4mo
0
Thank you so much! PadmeOragana 41 — 4mo
Ad

Answer this question