|
| 12 Jun 2013 07:30 PM |
is this correct.
function OnClick()
script.Parent.Parent.Door.Transparency = 0 wait(0.2) script.Parent.Parent.Door.Transparency = 0.1 wait(0.2) script.Parent.Parent.Door.Transparency = 0.2 wait(0.2) script.Parent.Parent.Door.Transparency = 0.3 wait(0.2) script.Parent.Parent.Door.Transparency = 0.4 wait(0.2) script.Parent.Parent.Door.Transparency = 0.5 wait(0.2) script.Parent.Parent.Door.Transparency = 0.6 wait(0.2) script.Parent.Parent.Door.Transparency = 0.7 wait(0.2) script.Parent.Parent.Door.Transparency = 0.8
function OnClick() - - So it can fade back to normal
script.Parent.Parent.Door.Transparency = 0.7 wait(0.2) - - and goes on into Transparency = 1 and end
Is it correct or am I missing something because it is failing
|
|
|
| Report Abuse |
|
|
Maradar
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 4478 |
|
|
| 12 Jun 2013 07:33 PM |
| Does the door have a object in it that it requires 2 parents? If not, just remove the extra parents. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2013 07:36 PM |
| Ok thank you, but the 1st order it works but when I want to click it a second time so it can close it doesn't. |
|
|
| Report Abuse |
|
|
Maradar
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 4478 |
|
|
| 12 Jun 2013 07:39 PM |
| script.Parent.Parent.Door.Transparency = 0 instead of script.Parent.Parent.Door.Transparency = 0.7 |
|
|
| Report Abuse |
|
|
keehl257
|
  |
| Joined: 12 May 2013 |
| Total Posts: 122 |
|
|
| 12 Jun 2013 07:58 PM |
| :3 why two functions for On Click() ? |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 08:24 AM |
| Well im not one of the best scripter im kind of new so. |
|
|
| Report Abuse |
|
|
sam8985
|
  |
| Joined: 12 Nov 2011 |
| Total Posts: 582 |
|
|
| 13 Jun 2013 08:41 AM |
local door = script.Parent.Door --or wherever your door is local faded = false function OnClick() if faded == false then for i = 0, 1, 0.1 do wait(.1) door.Transparency = i end faded = true end elseif faded then for i = 1, 0, -0.1 do wait(.1) door.Transparency = i end faded = false end door.ClickDetector.MouseClick:connect(OnClick) |
|
|
| Report Abuse |
|
|