|
| 21 Aug 2016 07:22 PM |
function OnClicked() script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.25 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.1 script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.1 wait(0.01) script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.3 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.2 script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.2 wait(0.01) script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.35 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.3 script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.3 wait(0.01) script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.4 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.4 script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.4 wait(0.01) script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.5 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.5 script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.5 wait(0.01) script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.6 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.6 script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.6 wait(0.01) script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.7 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.7 script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.7 wait(0.01) script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.8 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.8 script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.8 wait(0.01) script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.9 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.9 script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.9 wait(0.01) script.Parent.Parent.Frame.TextLabel.TextTransparency = 1 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 1 script.Parent.Parent.Parent.Shadow.ImageTransparency = 1 wait(0.01) script.Parent.Parent.Frame.TextLabel.Visible = true script.Parent.Parent.Parent.Taskbar.Visible = true script.Parent.Parent.Parent.Shadow.Visible = true wait(0.01)
script.Parent.MouseButton1Down:connect(OnClicked)
Is there something wrong with that script? It goes in a Imagebutton
Also any way to simplify the script?
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 21 Aug 2016 07:24 PM |
For loop. look it up on the wiki
|
|
|
| Report Abuse |
|
|
|
| 21 Aug 2016 07:24 PM |
| yes use loops and variables please |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2016 07:25 PM |
"For loop" Look at his script again. |
|
|
| Report Abuse |
|
|
Encladeus
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 3839 |
|
|
| 21 Aug 2016 07:26 PM |
function Transparency(n) script.Parent.Parent.Frame.TextLabel.TextTransparency = n script.Parent.Parent.Parent.Taskbar.ImageTransparency = n script.Parent.Parent.Parent.Shadow.ImageTransparency = n end
function OnClicked() local T = 0 for i = 1, 10 do wait(0.01) T = T + 0.1 Transparency(T) end wait(0.01) script.Parent.Parent.Frame.TextLabel.Visible = true script.Parent.Parent.Parent.Taskbar.Visible = true script.Parent.Parent.Parent.Shadow.Visible = true end
script.Parent.MouseButton1Down:connect(OnClicked) |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2016 07:26 PM |
| all he has to do is add in a simple conditional for the 1 exception |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2016 07:27 PM |
@enc
script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.3 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.2 script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.2
also, really guys? have you noticed he used MouseButton1Down for click detectors? |
|
|
| Report Abuse |
|
|
Encladeus
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 3839 |
|
|
| 21 Aug 2016 07:27 PM |
| My bad, you can't wait for (0.01) just leave it blank because you cannot wait shorter than 0.03 |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2016 07:29 PM |
"also, really guys? have you noticed he used MouseButton1Down for click detectors?"
"It goes in an Imagebutton"
uh what? |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 21 Aug 2016 07:30 PM |
You're stupid if you don't think a for loop can clean up his code.
|
|
|
| Report Abuse |
|
|
|
| 21 Aug 2016 07:32 PM |
Never said otherwise. It's just that this snippet of code will probably bork it up if you blantly use it.
script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.3 script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.2 script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.2 |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 21 Aug 2016 07:36 PM |
local a = {0.25, 0.3, 0.35}
function OnClicked() for i = 1,10 do script.Parent.Parent.Frame.TextLabel.TextTransparency = a[i] or i/10 script.Parent.Parent.Parent.Taskbar.ImageTransparency = i/10 script.Parent.Parent.Parent.Shadow.ImageTransparency = i/10 wait() end script.Parent.Parent.Frame.TextLabel.Visible = true script.Parent.Parent.Parent.Taskbar.Visible = true script.Parent.Parent.Parent.Shadow.Visible = true end
script.Parent.MouseButton1Down:connect(OnClicked)
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 21 Aug 2016 07:37 PM |
you should probably make variables for that stuff to clean it up more tho, i just copy pasted it.
|
|
|
| Report Abuse |
|
|
|
| 21 Aug 2016 07:43 PM |
| The current script i have wont work, and im not sure why, Any idea why it wont work |
|
|
| Report Abuse |
|
|