DrSaint
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 18429 |
|
|
| 20 Jun 2015 04:15 AM |
script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked) script.Parent.Transparency = 0.1 wait(0.1) script.Parent.Transparency = 0.3 wait(0.1) script.Parent.Transparency = 0.5 wait(0.1) script.Parent.Transparency = 0.7 wait(0.1) script.Parent.Transparency = 0.9 wait(0.1) script.Parent.Transparency = 1 wait(0.1) script.Parent:Destroy()
script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked) end)
I have plans for MouseButton1Click and MouseButton2Click, which is why I defined them like that. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 20 Jun 2015 04:19 AM |
for t = 0.1, 0.9, 0.2 do script.Parent.Transparency = t; wait(0.1); end script.Parent.Transparency = 1; |
|
|
| Report Abuse |
|
|
Jammer622
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 1739 |
|
|
| 20 Jun 2015 04:20 AM |
...connect(function(OnClicked) for X = 1, 6 do script.Parent.Transparency = math.min(-0.1 + 0.2 * X, 1) wait(0.1) end script.Parent:Destroy()...
You were looking for a loop, I believe. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 20 Jun 2015 04:22 AM |
script.Parent.MouseButton1Click.MouseClick:connect(function() for i = .1,.9,.2 do script.Parent.Transparency = i; wait(.1); end; script.Parent.Transparency = 1; script.Parent:Destroy(); end); |
|
|
| Report Abuse |
|
|
DrSaint
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 18429 |
|
|
| 20 Jun 2015 04:31 AM |
| None of them worked. I'm confused. |
|
|
| Report Abuse |
|
|
StarWars
|
  |
| Joined: 04 Jan 2007 |
| Total Posts: 500 |
|
|
| 20 Jun 2015 04:34 AM |
| Is this for a gui or a brick? |
|
|
| Report Abuse |
|
|
DrSaint
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 18429 |
|
| |
|
StarWars
|
  |
| Joined: 04 Jan 2007 |
| Total Posts: 500 |
|
|
| 20 Jun 2015 04:37 AM |
script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked) script.Parent.Transparency = 0.1 wait(0.1) script.Parent.Transparency = 0.3 wait(0.1) script.Parent.Transparency = 0.5 wait(0.1) script.Parent.Transparency = 0.7 wait(0.1) script.Parent.Transparency = 0.9 wait(0.1) script.Parent.Transparency = 1 wait(0.1) script.Parent:Destroy()
script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked) end)
You are calling script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked) twice and you will be missing an end with this. Remove the second script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked)
|
|
|
| Report Abuse |
|
|
Jammer622
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 1739 |
|
|
| 20 Jun 2015 04:38 AM |
| How could none of them work? I thought this was simplifying a script, not fixing one? .-. |
|
|
| Report Abuse |
|
|
DrSaint
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 18429 |
|
|
| 20 Jun 2015 04:42 AM |
I put it in a local script.
local part = game.Workspace.Part1 game.Workspace.Part1.MouseButton1Click.MouseClick:connect(function() for i = .1,.9,.2 do script.Parent.Transparency = i; wait(.1); end; script.Parent.Transparency = 1; script.Parent:Destroy(); end); |
|
|
| Report Abuse |
|
|
StarWars
|
  |
| Joined: 04 Jan 2007 |
| Total Posts: 500 |
|
|
| 20 Jun 2015 04:43 AM |
That should work and you can use part.MouseButton1Click.MouseClick:connect(function() instead of game.Workspace.Part1 |
|
|
| Report Abuse |
|
|
DrSaint
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 18429 |
|
|
| 20 Jun 2015 04:45 AM |
I'm not getting any kind of error.
Is the script not running? |
|
|
| Report Abuse |
|
|
StarWars
|
  |
| Joined: 04 Jan 2007 |
| Total Posts: 500 |
|
|
| 20 Jun 2015 04:52 AM |
| Do you have a ClickDetector inside? And is the script enabled? |
|
|
| Report Abuse |
|
|
DrSaint
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 18429 |
|
|
| 20 Jun 2015 04:54 AM |
| Yup. I feel like a total idiot right now but I still don't understand what's going on. |
|
|
| Report Abuse |
|
|