Implore
|
  |
| Joined: 22 Aug 2011 |
| Total Posts: 4996 |
|
|
| 26 Nov 2016 11:17 PM |
script.Parent.Parent.ClickDetector.MouseClick:connect(function(onClick) script.Parent.Parent.Transparency = 1 script.Parent.Parent.CanCollide = true if script.Parent.Parent.CanCollide == true then wait(5) script.Parent.Parent.CanCollide = false if script.Parent.Parent.Transparency == 1 then wait(5) script.Parent.Parent.Transparency = 0 end end end)
--returns that Model1 isn't a valid member of Model
trying to make it where if Transparency = 1 then it goes back to 0
can someone help?
|
|
|
| Report Abuse |
|
|
Implore
|
  |
| Joined: 22 Aug 2011 |
| Total Posts: 4996 |
|
|
| 26 Nov 2016 11:18 PM |
| Also, am I suppose to put the ClickDetector in part or put the script inside of ClickDetector? |
|
|
| Report Abuse |
|
|
Implore
|
  |
| Joined: 22 Aug 2011 |
| Total Posts: 4996 |
|
|
| 26 Nov 2016 11:21 PM |
| EDIT: it works, I fixed it |
|
|
| Report Abuse |
|
|
Implore
|
  |
| Joined: 22 Aug 2011 |
| Total Posts: 4996 |
|
|
| 26 Nov 2016 11:26 PM |
Another question though
if I have a model, can I use one script to do the same above instead of making so many copies for each part?
If so, what would I do? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 26 Nov 2016 11:53 PM |
for loops.
--click detector
bool = not bool
for i,v in next, model:GetChildren() do if bool then v.Transparency = 1 else v.Transparency = 0 end end
|
|
|
| Report Abuse |
|
|
Implore
|
  |
| Joined: 22 Aug 2011 |
| Total Posts: 4996 |
|
|
| 27 Nov 2016 12:03 AM |
Now it goes away 1 part by 1 part, but I want it to go away as a whole.
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 27 Nov 2016 12:04 AM |
dont add any waits in the loop
also if u must paste code
|
|
|
| Report Abuse |
|
|