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:
This is what the new text above the buttons looks like:
Here’s a video to show you what keeps happening
If anybody knows how I can fix this please let me know.
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!
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
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!
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
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.
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
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?