AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 26 Feb 2012 08:28 PM |
Help me with this output & how to fix it. 20:11:37 - Workspace.Model.Script:19: 'eof' expected near 'else'
Model -Script -TheValue (BoolValue) -Parts --Part1 --Part2 --Part3 --Part4 -Button
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part2 = script.Parent.Parts.Part2 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4
function onClicked() script.Parent.Button.MouseClick.ClickDetector:click() if TheVal==true then for i=1,10 do wait(.01) Part1.CFrame=CFrame.new(1,0,0) Part2.CFrame=CFrame.new(1,0,0) TheValue = false end end end else end if TheVal==false then for i=1,10 do wait(.01) Part3.CFrame=CFrame.new(1,0,0) Part4.CFrame=CFrame.new(1,0,0) TheValue = true end end end)
|
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
| |
|
|
| 26 Feb 2012 08:36 PM |
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part2 = script.Parent.Parts.Part2 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4
function onClicked() script.Parent.Button.MouseClick.ClickDetector:click() if TheVal==true then for i=1,10 do wait(.01) Part1.CFrame=CFrame.new(1,0,0) Part2.CFrame=CFrame.new(1,0,0) TheValue = false end end end if TheVal==false then for i=1,10 do wait(.01) Part3.CFrame=CFrame.new(1,0,0) Part4.CFrame=CFrame.new(1,0,0) TheValue = true end Else End end
Try this if it does not work, give me the output. end)
|
|
|
| Report Abuse |
|
|
|
| 26 Feb 2012 08:37 PM |
Ooops, remove the
Try this, if it does not work, give me the output. |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 26 Feb 2012 08:46 PM |
| 20:45:37 - Workspace.Model.Script:28: 'eof' expected near 'end' |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 26 Feb 2012 08:47 PM |
No output.
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part2 = script.Parent.Parts.Part2 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4
function onClicked() script.Parent.Button.MouseClick.ClickDetector:click() if TheVal==true then for i=1,10 do wait(.01) Part1.CFrame=CFrame.new(1,0,0) Part2.CFrame=CFrame.new(1,0,0) TheVal = false end end end if TheVal==false then for i=1,10 do wait(.01) Part3.CFrame=CFrame.new(1,0,0) Part4.CFrame=CFrame.new(1,0,0) TheVal = true end else end end end)
|
|
|
| Report Abuse |
|
|
|
| 26 Feb 2012 08:51 PM |
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part2 = script.Parent.Parts.Part2 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4 script.Parent.Button.MouseClick:connect(function(click) if TheVal.Value then for i=1,10 do wait(.01) Part1.CFrame=CFrame.new(1,0,0) Part2.CFrame=CFrame.new(1,0,0) TheVal.Value = false end end elseif not TheVal.Value then for i=1,10 do wait(.01) Part3.CFrame=CFrame.new(1,0,0) Part4.CFrame=CFrame.new(1,0,0) TheVal.Value = true end else end)
?
† KMXD † |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 26 Feb 2012 08:55 PM |
Okay so, output: 20:54:47 - Workspace.Model.Script:30: 'eof' expected near 'end'
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part2 = script.Parent.Parts.Part2 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4
function onClicked() script.Parent.Button.MouseClick.ClickDetector:click() if TheVal==true then for i=1,10 do wait(.01) Part1.CFrame=CFrame.new(1,0,0) Part2.CFrame=CFrame.new(1,0,0) TheVal = false script.Parent.Button.BrickColor=BrickColor.new("Bright green") end end end if TheVal==false then for i=1,10 do wait(.01) Part3.CFrame=CFrame.new(-1,0,0) Part4.CFrame=CFrame.new(-1,0,0) TheVal = true script.Parent.Button.BrickColor=BrickColor.new("Bright green") end else end end end)
|
|
|
| Report Abuse |
|
|
|
| 26 Feb 2012 08:56 PM |
Try mine, and tell me the output. You can add the color things if you wish.
† KMXD † |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 26 Feb 2012 08:59 PM |
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part2 = script.Parent.Parts.Part2 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4 script.Parent.Button.MouseClick:connect(function(click) if TheVal.Value then for i=1,10 do wait(.01) Part1.CFrame=CFrame.new(1,0,0) Part2.CFrame=CFrame.new(1,0,0) TheVal.Value = false script.Parent.Button.BrickColor=BrickColor.new("Bright green") end end elseif not TheVal.Value then for i=1,10 do wait(.01) Part3.CFrame=CFrame.new(1,0,0) Part4.CFrame=CFrame.new(1,0,0) TheVal.Value = true script.Parent.Button.BrickColor=BrickColor.new("Bright green") end else end)
20:58:26 - Workspace.Model.Script:17: 'end' expected (to close 'function' at line 7) near 'elseif' |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2012 09:12 PM |
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part2 = script.Parent.Parts.Part2 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4
script.Parent.Button.MouseClick:connect(function(click) if TheVal.Value then for i=1,10 do wait(.01) Part1.CFrame=CFrame.new(1,0,0) Part2.CFrame=CFrame.new(1,0,0) TheVal.Value = false script.Parent.Button.BrickColor=BrickColor.new("Bright green") end elseif not TheVal.Value then for i=1,10 do wait(.01) Part3.CFrame=CFrame.new(1,0,0) Part4.CFrame=CFrame.new(1,0,0) TheVal.Value = true script.Parent.Button.BrickColor=BrickColor.new("Bright green") end end end)
?
† KMXD † |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 27 Feb 2012 06:43 AM |
06:42:56 - MouseClick is not a valid member of Part 06:42:56 - Script "Workspace.Model.Script", Line 8 06:42:56 - stack end |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 27 Feb 2012 07:02 AM |
HERE IS THE WORKING SCRIPT.
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part2 = script.Parent.Parts.Part2 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4
script.Parent.Button.ClickDetector.MouseClick:connect(function(click) if TheVal.Value then for i=1,10 do wait(.01) Part1.CFrame=CFrame.new(1,0,0) Part2.CFrame=CFrame.new(1,0,0) TheVal.Value = false script.Parent.Button.BrickColor=BrickColor.new("Bright green") end elseif not TheVal.Value then for i=1,10 do wait(.01) Part3.CFrame=CFrame.new(1,0,0) Part4.CFrame=CFrame.new(1,0,0) TheVal.Value = true script.Parent.Button.BrickColor=BrickColor.new("Bright green") end end end)
Now, we have to make the parts move like they're supose to. They move from their positions.. <_< |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 27 Feb 2012 07:13 AM |
YES YES YES!
I just edited it and made my first fairly advance script!
evar! :DDD |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 27 Feb 2012 07:17 AM |
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4
script.Parent.Button.ClickDetector.MouseClick:connect(function(click) if TheVal.Value==true then for i=1,10 do wait(.1) Part1.CFrame = Part1.CFrame - Vector3.new(1,0,0) Part3.CFrame = Part3.CFrame - Vector3.new(-1,0,0) Part4.CFrame = Part4.CFrame - Vector3.new(-1,0,0) TheVal.Value = false script.Parent.Button.BrickColor=BrickColor.new("Bright red") end elseif TheVal.Value==false then for i=1,10 do wait(.1) Part1.CFrame = Part1.CFrame - Vector3.new(-1,0,0) Part3.CFrame = Part3.CFrame - Vector3.new(1,0,0) Part4.CFrame = Part4.CFrame - Vector3.new(1,0,0) TheVal.Value = true script.Parent.Button.BrickColor=BrickColor.new("Bright green") end end end)
So, how would I prevent them from clicking it over and over and messing up the gate? |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2012 07:19 AM |
| Can you pleeease post the final script you've edited? The working one. Thankyou! :) |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 27 Feb 2012 07:28 AM |
| I think I need to add debounce. |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
| |
|
|
| 27 Feb 2012 04:42 PM |
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4 deb = false
script.Parent.Button.ClickDetector.MouseClick:connect(function(click) if TheVal.Value==true then if not deb then deb = true for i=1,10 do wait(.1) Part1.CFrame = Part1.CFrame - Vector3.new(1,0,0) Part3.CFrame = Part3.CFrame - Vector3.new(-1,0,0) Part4.CFrame = Part4.CFrame - Vector3.new(-1,0,0) TheVal.Value = false script.Parent.Button.BrickColor=BrickColor.new("Bright red") end elseif TheVal.Value==false then for i=1,10 do wait(.1) Part1.CFrame = Part1.CFrame - Vector3.new(-1,0,0) Part3.CFrame = Part3.CFrame - Vector3.new(1,0,0) Part4.CFrame = Part4.CFrame - Vector3.new(1,0,0) TheVal.Value = true script.Parent.Button.BrickColor=BrickColor.new("Bright green") deb = false end end end end)
† KMXD † |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 27 Feb 2012 04:45 PM |
Dont I need to add a "debounce" boolvalue to the model and have:
debounce = script.Parent.debounce.Value |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 27 Feb 2012 04:46 PM |
WAIT!
It worked when opening, but when I re-clicked it while it was a red brick it broke. |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2012 04:47 PM |
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4 deb = false script.Parent.Button.ClickDetector.MouseClick:connect(function(click) if not deb then if TheVal.Value==true then deb = true for i=1,10 do wait(.1) Part1.CFrame = Part1.CFrame - Vector3.new(1,0,0) Part3.CFrame = Part3.CFrame - Vector3.new(-1,0,0) Part4.CFrame = Part4.CFrame - Vector3.new(-1,0,0) TheVal.Value = false script.Parent.Button.BrickColor=BrickColor.new("Bright red") end elseif TheVal.Value==false then for i=1,10 do wait(.1) Part1.CFrame = Part1.CFrame - Vector3.new(-1,0,0) Part3.CFrame = Part3.CFrame - Vector3.new(1,0,0) Part4.CFrame = Part4.CFrame - Vector3.new(1,0,0) TheVal.Value = true script.Parent.Button.BrickColor=BrickColor.new("Bright green") deb = false end end end end)
† KMXD † |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 27 Feb 2012 05:00 PM |
| That's odd.. I can't save the place when I put that script in... |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 27 Feb 2012 05:04 PM |
Add the brickcolor in between to this, and it should work fine.
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4 deb = false
script.Parent.Button.ClickDetector.MouseClick:connect(function(click) if TheVal.Value==true then if not deb then deb = true for i=1,10 do wait(.1) Part1.CFrame = Part1.CFrame - Vector3.new(1,0,0) Part3.CFrame = Part3.CFrame - Vector3.new(-1,0,0) Part4.CFrame = Part4.CFrame - Vector3.new(-1,0,0) TheVal.Value = false script.Parent.Button.BrickColor=BrickColor.new("Bright red") end elseif TheVal.Value==false then for i=1,10 do wait(.1) Part1.CFrame = Part1.CFrame - Vector3.new(-1,0,0) Part3.CFrame = Part3.CFrame - Vector3.new(1,0,0) Part4.CFrame = Part4.CFrame - Vector3.new(1,0,0) TheVal.Value = true script.Parent.Button.BrickColor=BrickColor.new("Bright green") deb = false end end end end) |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 27 Feb 2012 05:21 PM |
Actually, this is working now. All you need to do is add interval brick color's and it will be done and fixed I bet.
script.Parent.TheValue.Value = true TheVal = script.Parent.TheValue Part1 = script.Parent.Parts.Part1 Part3 = script.Parent.Parts.Part3 Part4 = script.Parent.Parts.Part4 deb = false script.Parent.Button.ClickDetector.MouseClick:connect(function(click) if not deb then if TheVal.Value==true then deb = true for i=1,10 do wait(.1) Part1.CFrame = Part1.CFrame - Vector3.new(1,0,0) Part3.CFrame = Part3.CFrame - Vector3.new(-1,0,0) Part4.CFrame = Part4.CFrame - Vector3.new(-1,0,0) TheVal.Value = false script.Parent.Button.BrickColor=BrickColor.new("Bright red") end elseif TheVal.Value==false then for i=1,10 do wait(.1) Part1.CFrame = Part1.CFrame - Vector3.new(-1,0,0) Part3.CFrame = Part3.CFrame - Vector3.new(1,0,0) Part4.CFrame = Part4.CFrame - Vector3.new(1,0,0) TheVal.Value = true script.Parent.Button.BrickColor=BrickColor.new("Bright green") deb = false end end end end) |
|
|
| Report Abuse |
|
|