|
| 15 Oct 2011 04:28 PM |
Parts = script.Parent.Parent:GetChildren() function onTouch(hit) human = hit.Parent:FindFirstChild("Humanoid") if human ~= nil then for i, v in pairs(Parts) do v.Decal.Transparency = 1 --Probably messed up here. v.CanCollide = false wait(3) v.Decal.Transparency = 0 v.CanCollide = true end end end --Okay, I'm new to these scripts. I'm assuming I messed up with the "v", but I may have messed up somewhere else. --When I checked Output, nothing was wrong. --The script is a Child of Part1, which is a Child of Model, which also contains Part2, Part3, and Part4. They all have a Decal in them. --Thanks for the help! -FinalNight |
|
|
| Report Abuse |
|
|
| |
|
GoldenUrg
|
  |
| Joined: 23 Aug 2009 |
| Total Posts: 6428 |
|
|
| 15 Oct 2011 04:47 PM |
| Your onTouch function is never called. Perhaps you're missing a connect? |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2011 04:51 PM |
| Along with what Golden said, in your script, the loop will run for each of the objects one at a time. That means, it will run first for one of the parts, and it will change the Transparency and CanCollide (do Decals even have Transparency?), then wait 3 seconds, then change them back. Only after that will it move on to changing the rest of the parts, one by one. What you might want to do is use one loop to change the transparency/cancollide to 1 and false for all of them, then wait 3 seconds, then use another loop to change them back. |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2011 04:59 PM |
| Okay, thanks. I hate (and forget) Event Listeners all the time. |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2011 05:06 PM |
Ugh, it's complaining about my Event Listeners. :L I used: Parts.Touched:connect(onTouched) Then it keeps giving me an error saying "Touched is a nil value", but it's an Event. :s |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2011 05:08 PM |
Parts is a table of Parts, not an actual Part.
You can either choose one Part to connect the event to, or use a loop to connect it to all of them. |
|
|
| Report Abuse |
|
|