|
| 07 May 2012 05:39 PM |
I need to make a script.
Please note, YOU don't have to make it, I do. But it would be appreciated if you DID.
I just need some help figuring out how to make it.
So, the script is a simple touch-button door. I would like to know how to make it check the name of the object before it can go through the door.
The object is called CUBE. when it touches the button, the door opens. Nothing else can open it. Cube doesn NOT have a humanoid.
|
|
|
| Report Abuse |
|
|
ozza
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 726 |
|
|
| 07 May 2012 05:41 PM |
script.Parent.Touched:connect(function(hit) if hit.Name == "Cube" then for i = 0,1,0.1 do script.Parent.Transparency = i script.Parent.CanCollide = false wait() end for i = 1,0,0.1 do script.Parent.Transparency = i script.Parent.CanCollide = true wait() end end end)
|
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 07 May 2012 05:43 PM |
@Ozza
"for i = 1,0,0.1 do"
You have to make it negative. If you make the third number positive it's already at that number, making the for loop end too early.
|
|
|
| Report Abuse |
|
|
ozza
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 726 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 07 May 2012 05:45 PM |
| Everyone makes mistakes :D |
|
|
| Report Abuse |
|
|
ozza
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 726 |
|
|
| 07 May 2012 05:49 PM |
| *starts singing hannah montana song* |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
|
| 07 May 2012 06:49 PM |
Thanks!
I'll test it as soon as the update finishes. |
|
|
| Report Abuse |
|
|
|
| 07 May 2012 08:27 PM |
I didn't use the whole script, just the part that checked for the name.
So.. Thanks! It worked! |
|
|
| Report Abuse |
|
|