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: Unknown script error

Previous Thread :: Next Thread 
THEMENDEZKID is not online. THEMENDEZKID
Joined: 18 Aug 2011
Total Posts: 2401
12 Jun 2014 09:49 PM
I am developing a script that opens a door with CFrame value and closes it every five seconds. However I can't seem to find the solution to this conflict.

Error; Workspace.Door.Script:88: ')' expected (to close '(' at line 3) near 'end'

*Keep in mind I am still a noob at scripting and that this script is an experiment upon my knowledge of Lua.

The script;

Door = script.Parent

Door.Touched:connect(function()
print("Door opening")
Door.CFrame = CFrame.new(Vector3.new(-10.8, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-10.6, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-10.4, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-10.2, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-10.0, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-9.8, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-9.6, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-9.4, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-9.2, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-9.0, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-8.8, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-8.6, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-8.4, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-8.2, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-8.0, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-7.8, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-7.6, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-7.4, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-7.2, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-7.0, 2.39, -6))
print("Door opened")
wait(5)
print("Door closing")
Door.CFrame = CFrame.new(Vector3.new(-7.2, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-7.4, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-7.6, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-7.8, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-8.0, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-8.2, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-8.4, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-8.6, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-8.8, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-9.0, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-9.2, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-9.4, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-9.6, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-9.8, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-10.0, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-10.2, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-10.4, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-10.6, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-10.8, 2.39, -6))
wait(.1)
Door.CFrame = CFrame.new(Vector3.new(-11.0, 2.39, -6))
print("Door closed")
end
end)
Report Abuse
ColorfulBrendon is not online. ColorfulBrendon
Joined: 28 Jul 2010
Total Posts: 23556
12 Jun 2014 09:53 PM
Door.CFrame = Vector3.new(-10.8, 2.39, -6)

I'm pretty sure you don't need to put a CFrame.new AND THEN a vector3.new

Also, instead of Cframe I recommend your script changes Position and Rotation, "Cframe" is NOT part of a Part's Data.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
12 Jun 2014 09:53 PM
First of all, loops. Use them.

Secondly, get rid of the end that doesn't have the ) after it, it's not needed

-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]
Report Abuse
ChosenDreamer is not online. ChosenDreamer
Joined: 23 Oct 2013
Total Posts: 15580
12 Jun 2014 09:54 PM
Well uh, first off, for loop pls, second, CFrame.new(number,number,number), not CFrame.new(Vector3.new(x,y,z)

That's unnecessary

You probably forgot a ')', or have one where it shouldn't be
Report Abuse
ColorfulBrendon is not online. ColorfulBrendon
Joined: 28 Jul 2010
Total Posts: 23556
12 Jun 2014 09:55 PM
If you want to Loop, use while true do, throw in another end, and put a wait() before the end.

Good to know if you want to loop.
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
12 Jun 2014 10:47 PM
Also, I don't think you need two 'end' closers. Since I don't see any other functions other than the trigger at the top.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jun 2014 10:50 PM
He can keep the Vector3's in there. It's one of the many constructors CFrame has.

CF.new(x, y, z) and CF.new(v3) work the same way.
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