squibs47
|
  |
| Joined: 14 Feb 2010 |
| Total Posts: 339 |
|
|
| 20 Jan 2011 05:45 AM |
Ok -.- Got frustrated with this. I made a model, named two of the parts Door1 and Door2, put ClickDetectors in BOTH and had the same scripts in both. But it won't work -.- Here's the script:
function onClicked() for i - 1,50 do script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0) script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0) wait() end wait(4) for i = 1,50 do script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0) script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0) wait() end end
script.Parent.ClickDetector.MouseClick(onClicked) |
|
|
| Report Abuse |
|
|
| |
|
squibs47
|
  |
| Joined: 14 Feb 2010 |
| Total Posts: 339 |
|
|
| 20 Jan 2011 05:47 AM |
Wait, thi is the script. (Fixed a few spelling errors.) Still won't work.
function onClicked() for i = 1,50 do script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0) script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0) wait() end wait(4) for i = 1,50 do script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0) script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0) wait() end end
script.Parent.ClickDetector.MouseClick(onClicked) |
|
|
| Report Abuse |
|
|
lasassin
|
  |
| Joined: 27 Feb 2009 |
| Total Posts: 831 |
|
|
| 20 Jan 2011 06:30 AM |
| Give me the structure of the model and I might be able to help. |
|
|
| Report Abuse |
|
|
micolord
|
  |
| Joined: 16 Mar 2009 |
| Total Posts: 1242 |
|
|
| 20 Jan 2011 06:59 AM |
| script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
micolord
|
  |
| Joined: 16 Mar 2009 |
| Total Posts: 1242 |
|
|
| 20 Jan 2011 07:00 AM |
function onClicked() for i = 1,50 do script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0) script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0) wait() end wait(4) for i = 1,50 do script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0) script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0) wait() end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
or...
script.Parent.ClickDetector.MouseClick:connect( function() for i = 1,50 do script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0) script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0) wait() end wait(4) for i = 1,50 do script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0) script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0) wait() end end) |
|
|
| Report Abuse |
|
|
squibs47
|
  |
| Joined: 14 Feb 2010 |
| Total Posts: 339 |
|
| |
|