Truste135
|
  |
| Joined: 26 Oct 2010 |
| Total Posts: 741 |
|
|
| 26 Sep 2012 04:52 AM |
Ok, so I'm trying to make it when you click a specific brick, it find the door, and opens it. I made this so far:
function onClicked() game.Workspace:FindFirstChild("Door") if found then game.Workspace.Door.CanCollide = true game.Workspace.Door.Transparency = 0.5 wait(9) game.Workspace.Door.CanCollide = false game.Workspace.Door.Transparency = 0 end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Does this work? |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2012 06:41 AM |
| If you try it and it doesn't work then the answer is no. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2012 06:51 AM |
function onClicked() local found = game.Workspace:FindFirstChild("Door") if found then --never defined 'found' game.Workspace.Door.CanCollide = true game.Workspace.Door.Transparency = 0.5 wait(9) game.Workspace.Door.CanCollide = false game.Workspace.Door.Transparency = 0 end end --missed an end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|