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

Please help, I don't know how to fix the ImageButton that I'm working on?

Asked by 8 years ago

Hello, for my question I'm trying to figure out how to program one of my builds, so basically I programmed it when you left click on an image, it would set the transparency to 1and bring out the information to 0. Here is the code I've created and a few pictures for you to look at so you can have a more understanding. The Code:

local InformationGUI = game.Workspace.AtomBromine.InformationOnBromine.SurfaceGui.Frame
local imageButton = InformationGUI.ImageButton

local firstLine = InformationGUI.FirstLine
local secondLine = InformationGUI.SecondLine
local thirdLine = InformationGUI.ThirdLine
local fourthLine = InformationGUI.FourthLine
local fifthLine = InformationGUI.FifthLine
local sixthLine = InformationGUI.SixthLine
local seventhLine = InformationGUI.SeventhLine

local ClickForInfo1 = InformationGUI.ClickImage1
local ClickForInfo2 = InformationGUI.ClickImage2
local title = InformationGUI.Title

imageButton.MouseButton1Click:connect(function()
    imageButton.ImageTransparency = 1

    firstLine.TextTransparency = 0
    secondLine.TextTransparency = 0
    thirdLine.TextTransparency = 0
    fourthLine.TextTransparency = 0
    fifthLine.TextTransparency = 0
    sixthLine.TextTransparency = 0
    seventhLine.TextTransparency = 0

    ClickForInfo1.TextTransparency = 1
    ClickForInfo2.TextTransparency = 1

    title.TextTransparency = 1

    wait(30)

    imageButton.ImageTransparency = 0

    firstLine.TextTransparency = 1
    secondLine.TextTransparency = 1
    thirdLine.TextTransparency = 1
    fourthLine.TextTransparency = 1
    fifthLine.TextTransparency = 1
    sixthLine.TextTransparency = 1
    seventhLine.TextTransparency = 1

    ClickForInfo1.TextTransparency = 0
    ClickForInfo2.TextTransparency = 0

    title.TextTransparency = 0
end)

And now the pictures to look at it, I will only show 2 pictures, one picture of the Explorer, and one to show what it does.

Link to see what's inside the Explorer: http://prnt.sc/8rzr7m

Link to see what is it in the game: http://prnt.sc/8rzq90 What is suppose to do is let you click on the image to bring out the information.

Thank you so much, I hope you will understand the question I'm talking about...

0
Is the SurfaceGui's adornee set to the part? If it's just in the part I don't think click events work. I might be wrong, but I think you need to set the adornee to the part. If you keep the SurfaceGui in the part anyone can change the status unless you set the adornee. Another problem, you never told us what it actually did or whether there were any errors, until you do this I cannot help. General_Scripter 425 — 8y
0
Will... I checked, and there's no errors, and I thought I did told you? When you click on the ImageButton, it sets the transparecy to the image, the title, and the info telling to click on the image set to 0, while it brings the information that was set to 0, to 1. teafulfireball 0 — 8y
0
This would be about 10 times easier if you sectioned off your gui into appropriate frames, that way you can just set the visibility of two different frames, or iterate through their children and manipulate the BackgroundTransparency Properties. Goulstem 8144 — 8y
0
And also how do I set teh Abornee? teafulfireball 0 — 8y
View all comments (3 more)
0
And also I located my Script inside the ServerScriptService teafulfireball 0 — 8y
0
Did you want it so players can all interact with the same gui or did you want each player to have their own? General_Scripter 425 — 8y
0
I want it so the players can all interact with the same gui teafulfireball 0 — 8y

Answer this question