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: Unexpected Symbol Near...

Previous Thread :: Next Thread 
pipsqueak609 is not online. pipsqueak609
Joined: 11 Dec 2010
Total Posts: 45
26 Feb 2012 05:02 PM
What does that mean? I'm new to scripting and I have no idea how to fix it or what it means.
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
26 Feb 2012 05:04 PM
It means you have a symbol that shouldn't be there.
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
26 Feb 2012 05:04 PM
It depends on what symbol it is. One useful thing to know in that regard is that "eof" means "end of file", that is, the end of the script.
Report Abuse
pipsqueak609 is not online. pipsqueak609
Joined: 11 Dec 2010
Total Posts: 45
26 Feb 2012 05:05 PM
I can't find the unexpected symbol....
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
26 Feb 2012 05:06 PM
Post the line of code that's erroring.
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
26 Feb 2012 05:06 PM
What's the whole error message, and the lines of code near it? (the line, and the lines before and after it)
Report Abuse
pipsqueak609 is not online. pipsqueak609
Joined: 11 Dec 2010
Total Posts: 45
26 Feb 2012 05:17 PM
I think it is this:

local player - game:GetService('player'):GetPlayerFromCharacter(otherPart.Parent) or game:GetService('player'):GetPlayerFromCharacter(otherPart.Parent.Parent)

The error line is:

Workspace.Part.Script:8: unexpected symbol near 'local'
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
26 Feb 2012 05:18 PM
local player = game:GetService('player'):GetPlayerFromCharacter(otherPart.Parent) or game:GetService('player'):GetPlayerFromCharacter(otherPart.Parent.Parent)


† KMXD †
Report Abuse
pipsqueak609 is not online. pipsqueak609
Joined: 11 Dec 2010
Total Posts: 45
26 Feb 2012 05:22 PM
It didn't work. The same error message popped up...
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
26 Feb 2012 05:23 PM
local player = game:GetService('Players'):GetPlayerFromCharacter(otherPart.Parent) or game:GetService('Players'):GetPlayerFromCharacter(otherPart.Parent.Parent)
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
26 Feb 2012 05:23 PM
GetService('player')

This should be:

GetService('Players')
Report Abuse
pipsqueak609 is not online. pipsqueak609
Joined: 11 Dec 2010
Total Posts: 45
26 Feb 2012 05:32 PM
Hmmmm the same message popped up >:( I can't get this....
Report Abuse
MrVoxx is not online. MrVoxx
Joined: 24 Feb 2012
Total Posts: 37
26 Feb 2012 05:35 PM
The number 6 is the line the error is on. THe error message means you have a symbol that is not correct. Which, will be on line 6.
Report Abuse
pipsqueak609 is not online. pipsqueak609
Joined: 11 Dec 2010
Total Posts: 45
26 Feb 2012 05:38 PM
door.Touched:connect(function(otherPart)

That is line 6
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
26 Feb 2012 05:38 PM
[ Content Deleted ]
Report Abuse
pipsqueak609 is not online. pipsqueak609
Joined: 11 Dec 2010
Total Posts: 45
26 Feb 2012 05:52 PM
Sure I used ROBLOX help script so...:


local user = "Pipsqueak609" -- The player's username. This user will be allowed through the door.
local groupId = 267773 -- The group's ID. Any user in this group will be allowed through the door.

local door = script.Parent -- The door. Assumes this script is in the door.

door.Touched:connect(function(otherPart)
if not otherPart.Parent then return
local player = game:GetService('Players'):GetPlayerFromCharacter(otherPart.Parent) or game:GetService('Players'):GetPlayerFromCharacter(otherPart.Parent.Parent)
if not (player and player.Character) then return end
if player.Name:lower() == user:lower() or player:IsInGroup(267773) then
local found = true
local anchoredState = door.Anchored -- Remember whether the door was anchored.
local transparencyState = door.Transparency -- Remember the door's tranparency.
door.Anchored = true
door.CanCollide = false
door.Transparency = .5
wait(2) -- You can change this if you want to edit for how long the door stays open.
door.CanCollide = true
door.Anchored = anchoredState -- Gives back to the door it previous anchored state.
door.Transparency = transparencyState -- Give back its transparency to the door.
end
if not found then
player.Character:BreakJoints() -- Kill the player if he's not allowed to go through. Remove this if you don't want the player to die.
end





Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
26 Feb 2012 05:55 PM
[ Content Deleted ]
Report Abuse
pipsqueak609 is not online. pipsqueak609
Joined: 11 Dec 2010
Total Posts: 45
26 Feb 2012 06:22 PM
Now another error message popped up:

Workspace.Part.Script:31: 'end' expected (to close 'function' at line 6) near ' eof '
eof is in <>

Here is line 6:

door.Touched:connect(function(otherPart)
Report Abuse
Masternintendo is not online. Masternintendo
Joined: 14 Sep 2008
Total Posts: 556
27 Feb 2012 02:00 AM
@Stravant OMG you just helped me out a lot. I did not know what eof meant. Thanks. I do have a lot of the unexpected symbol near things too. Ex.
/ should be near '(' (line 6)

Then I make a change by putting a / in front of it. Then it says: Unexpected symbol near '('

I get rid of it. It says: / should be near '(' (line 6) again.

This time I put it behind it.

Then it says: Unexpected symbol near '('

And that's why I sometimes get frustrated when scripting.
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
27 Feb 2012 02:07 AM
need to append "end)" to the end of the script.
Report Abuse
Rep0man is not online. Rep0man
Joined: 30 Jul 2013
Total Posts: 52
29 Aug 2014 05:49 PM
Yeah, you opened parenthesis then opened more inside of them. You only closed one of them. Just add a ) at the end of the line.
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