How do I make it so that the text above the buttons in my tycoon disappear with the button

So I am using Zed’s Tycoon kit to make a tycoon. I really don’t like the way the text above the buttons looks. So I figured I would change it with my own GUI. When I added it though, the button disappeared like it did from the start, but the gui I added didn’t. I want to know how I can make it so that my new GUI disappears with the button.

This is what the old text above the buttons looked like:
image

This is what the new text above the buttons looks like:
image

Here’s a video to show you what keeps happening

If anybody knows how I can fix this please let me know.

Just parent the billboard gui to the button. When an instance is destroyed, all of it’s children are destroyed as well.

We will need to see your code first, to see where the error is occuring. We can’t really help you otherwise. However, here are some things you can do:
When you step on the button, include a simple if statement, for example

if script.Parent:FindFirstChild("BillboardGui") then
    script.Parent.BillboardGui:Destroy()
end

If you need more help, you will really need to tell us your setup (i.e where the billboard gui is located, and some of your script) so we can help you. Best of luck!

image
The billboard GUI is inside of the begin working button. I checked the parent and it said that the begin working button is the parent

When you click the button, does it turn its transparency to 0, or simply delete it? If it just deletes the “Begin Working! - [$0]” then like @XdJackyboiiXd21 said, then it should delete the billboardgui

Make sure you name the new gui EXACTLY the same as the old gui you replaced, so if the script asks for the name, it knows what to hide

It sets the transparency to 1.

By the way Zeds tycoon kit used a humanoid for the old text. They just set it to viewer so it would show the name

Okay, so go into the code, where it sets the parts transparency. Under that, write an if statement like this (in this example, I am referring to the button as “Part”)

Part.Transparency = 1 -- the button that is hiding
if Part:FindFirstChild("BillboardGui") then
    Part.BillboardGui:Destroy()
end

That is just a simple example that checks if the button has the billboardgui, and deletes it. You will have to adjust it to modify the code, but it should work. Just ignore the fact that the old button had a humanoid, it shouldn’t matter. Best of luck!


This is what the part of the code where the button goes transparent. Where do I add the code you gave me?


there is also this

That second image shouldn’t matter, but for the first, put under where it says

v.Head.Transparency = 1

put

--This goes under where it says "v.Head.Transparency = 1"

if v:FindFirstChild("BillboardGui") then
     v.BillboardGui.Enabled = false --Just disable it if you don't feel like deleting it
     --if instead you want to delete it, put v.BillboardGui:Destroy()
end

this should work for you, sorry it took me a while to respond (I was eating dinner). If this solves it, please mark it as the solution, so others know it is complete :wink:

So what happens is I only added the GUI so far to one button. And when I added that to the script and playtested it, the whole tycoon was complete.

The issue is, when I added that to the script, and playtested the game it showed the whole tycoon as complete and broke. I think that might be because I only added the GUI to one button so far?

Alright update. The script just makes the tycoon stay the same. I added the script like you said and now instead of the tycoon breaking, it just stays the same as before.

-- hide, but not destroy
YourBillBoardGUIInstance.Enabled = false

-- destroy forever
YourBillBoardGUIInstance.Destroy()

And where do I put that? Where on the script do I put that?

It’s still not working, Maybe I’m doing something wrong?

Sorry it took me so long to get back (I was sleeping). The line I put in shouldn’t affect it at all, as all it does is check if there is a screen gui, and hide/destroy it. You may have put it in the wrong spot, try moving it aroud

There were 2 screen GUIS. I deleted them both and tried it and it didn’t work. Is there something else I should do?

I’m getting really confused, I think that’s because I’m not to good at programming. Can I give you permission to the studio so you can help me with that?