generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Gate Door

Previous Thread :: Next Thread 
AntiFiter is not online. 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 is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
26 Feb 2012 08:32 PM
sad face
Report Abuse
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
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
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
26 Feb 2012 08:37 PM
Ooops, remove the

Try this, if it does not work, give me the output.
Report Abuse
AntiFiter is not online. 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 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
TheSoMekTime is not online. TheSoMekTime
Joined: 14 Mar 2009
Total Posts: 191
27 Feb 2012 07:19 AM
Can you pleeease post the final script you've edited? The working one. Thankyou! :)
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
27 Feb 2012 07:28 AM
I think I need to add debounce.
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
27 Feb 2012 04:40 PM
^^^
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. 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 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image