Pro_JC
|
  |
| Joined: 08 Jul 2011 |
| Total Posts: 2701 |
|
|
| 30 Jul 2017 04:12 PM |
Trying to create an ImageButton within a Frame but only if the Task Google is open.
if script.Parent.Parent.Parent.Background.Tabs.GoogleTab.Visible == true then local App = Instance.new("ImageButton",script.Parent) script.Parent.ImageButton.Name = 'GoogleApp' script.Parent.GoogleApp.Zindex = 7 end
Pineapples do not belong on Pizza |
|
|
| Report Abuse |
|
|
devHoodie
|
  |
| Joined: 04 Nov 2008 |
| Total Posts: 30332 |
|
|
| 30 Jul 2017 04:27 PM |
first off
instead of doing this
local App = Instance.new("ImageButton",script.Parent) script.Parent.ImageButton.Name = 'GoogleApp' script.Parent.GoogleApp.Zindex = 7
you can do this
local App = Instance.new("ImageButton",script.Parent) App.Name = 'GoogleApp' App.Zindex = 7
Also, look inside explorer in studio and tell me if it's there or not. |
|
|
| Report Abuse |
|
|
Pro_JC
|
  |
| Joined: 08 Jul 2011 |
| Total Posts: 2701 |
|
|
| 30 Jul 2017 04:33 PM |
Well, I played around with it and I got it to work. It's the 'if' statement that stops it from opening.
Pineapples do not belong on Pizza |
|
|
| Report Abuse |
|
|
Pro_JC
|
  |
| Joined: 08 Jul 2011 |
| Total Posts: 2701 |
|
|
| 30 Jul 2017 04:49 PM |
I don't understand how that IF statement stops the entire script from functioning...
if script.Parent.Parent.Parent.Background.Tabs.GoogleTab.Visible == true then wait(1) local App = script.Parent local Taskapp = Instance.new("ImageButton",App) App.ImageButton.Name = 'GoogleApp' App.GoogleApp.ZIndex = 7 App.GoogleApp.Size = UDim2.new(0,50,0,50) App.GoogleApp.BorderSizePixel = 0 App.GoogleApp.BackgroundTransparency = 0.5 App.GoogleApp.Image = '' end
Pineapples do not belong on Pizza |
|
|
| Report Abuse |
|
|