Fydo
|
  |
| Joined: 12 Jul 2009 |
| Total Posts: 5653 |
|
|
| 09 Aug 2011 10:18 AM |
The output of course, yet again won't tell my why this won't work. Maybe one of you is smarter than the output :p
d = script.Parent t = d.Transparency
function open()
d.CanCollide = false while true do t = t + .1 wait(.1) if t == 1 then break end end end
function close()
d.CanCollide = false while true do t = t - .1 wait(.1) if t == 0 then break end end end function onClicked() open() wait(5) close()
end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 10:18 AM |
| So there's no output error AT ALL? |
|
|
| Report Abuse |
|
|
Fydo
|
  |
| Joined: 12 Jul 2009 |
| Total Posts: 5653 |
|
|
| 09 Aug 2011 10:20 AM |
| There was but I fixed them, now there's not, yet the script isn't working. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 10:22 AM |
| What's the script supposed to do? :/ |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 10:23 AM |
@Vortex - I think it's supposed to gradually increase and decrease the transparency of a part...
@OP - There's a much better way of doing this, you know. :/ |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 10:26 AM |
Eww. I see.
debounce = false
function open() while script.Parent.Transparency < 1 do script.Parent.Transparency = script.Parent.Transparency + 0.1 wait() end script.Parent.CanCollide = false end
function close() while script.Parent.Transparency > 0 do script.Parent.Transparency = script.Parent.Transparency - 0.1 wait() end script.Parent.CanCollide = true end
function onClicked() if debounce then return else debounce = true end open() wait(5) close() end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 10:28 AM |
I figured out why the original wasn't working.
When you do
t = d.Transparency
You are saving the current transparency of the door as a NUMBER. You are not saving it as a path to the property, eg
Workspace.Model.Door.Transparency
When you were modifying the number, you were just modifying a number that had basically nothing to do with anything. |
|
|
| Report Abuse |
|
|
Fydo
|
  |
| Joined: 12 Jul 2009 |
| Total Posts: 5653 |
|
|
| 09 Aug 2011 10:29 AM |
| Oh ok. Thank you very much. I wish the output was that smart >.> |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 10:52 AM |
| When the heck is with all the ends? |
|
|
| Report Abuse |
|
|