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 
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
03 Feb 2012 05:44 PM
ErrorMsg.Text:sub(1, (i - 2)).." '"..ErrorMsg.sub(i, string.len(ErrorMsg.Text))

I see nothing wrong with this.
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
03 Feb 2012 05:49 PM
ErrorMsg.sub

That should be

ErrorMsg:sub
Report Abuse
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
03 Feb 2012 05:50 PM
You have a apostrophe beside in front of the second quotation marks. I don't see any reason for it to be there.

ErrorMsg.Text:sub(1, (i - 2)).." "..ErrorMsg.sub(i, string.len(ErrorMsg.Text))
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
03 Feb 2012 05:54 PM
@dark
I fixed that, but it still returns the error.

@Neon
With, or without the apostrophe; the code returns the error.
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
03 Feb 2012 06:52 PM
Bump.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
03 Feb 2012 07:20 PM
" '"

Did you close this? Because it looks like you did

" "'

Meaning you didn't close the first quote. Did you?
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
03 Feb 2012 07:26 PM
I closed it.
Report Abuse
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
03 Feb 2012 07:49 PM
string.sub(ErrorMsg.Text, 1, (i-2)) .. " '" .. string.sub(ErrorMsg.Text, 1, string.len(ErrorMsg.Text))

Report Abuse
LuisPambid is not online. LuisPambid
Joined: 31 Mar 2011
Total Posts: 532
03 Feb 2012 08:07 PM
Try this:

ErrorMsg.Text:sub(1, (i - 2)).." '"..ErrorMsg.Text:sub(i, string.len(ErrorMsg.Text))
or
ErrorMsg.Text:sub(1, (i - 2)).." '"..ErrorMsg:sub(i, string.len(ErrorMsg.Text))
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
03 Feb 2012 08:08 PM
You're version makes no difference; it still returns an error.
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
03 Feb 2012 08:37 PM
Bump.
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
03 Feb 2012 09:06 PM
What is ErrorMessage? A gui text label?

[=|I rate myself 6.5/10 in RBLX.Lua|=]
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
03 Feb 2012 09:29 PM
Yes.
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
03 Feb 2012 09:30 PM
Could you please post the whole loop?

[=|I rate myself 6.5/10 in RBLX.Lua|=]
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
03 Feb 2012 09:36 PM
for i = 1, string.len(ErrorMsg.Text) do
if ErrorMsg.Text:sub(i, i):match("%d") then
if not ErrorMsg.Text:sub((i - 1), (i - 1)):match("%d") then
ErrorMsg.Text:sub(1, (i - 2)).." '"..ErrorMsg.Text:sub(i, string.len(ErrorMsg.Text))
elseif not ErrorMsg.Text:sub((i + 1), (i + 1)):match("%d") then
ErrorMsg.Text:sub(1, i).."' "..ErrorMsg.sub((i + 2), string.len(ErrorMsg.Text))
end
end
elseif ErrorMsg.Text:sub(i, i) == "\\" then
ErrorMsg.Text = ErrorMsg.Text:sub(1, (i - 1))..""..ErrorMsg.Text:sub(i + 1, string.len(ErrorMsg.Text))
end
Report Abuse
LuisPambid is not online. LuisPambid
Joined: 31 Mar 2011
Total Posts: 532
03 Feb 2012 10:29 PM
So what does it do?
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
03 Feb 2012 10:51 PM
Probably a separator of some sort.

[=|I rate myself 6.5/10 in RBLX.Lua|=]
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
04 Feb 2012 07:59 AM
What it's supposed to do is look through a string, remove every quotation mark, and make it a apostrophe. It's also supposed to remove a backslash in the string.
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
04 Feb 2012 10:21 AM
Bump.
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
04 Feb 2012 10:27 AM
[ Content Deleted ]
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
04 Feb 2012 10:38 AM
So, the gsub method removes certain characters from a string?
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
04 Feb 2012 10:54 AM
[ Content Deleted ]
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
04 Feb 2012 10:57 AM
What if I just wanted to remove part of a string then?

`*\~-{ Are we there yet T.T? }-~/*`
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
04 Feb 2012 11:11 AM
[ Content Deleted ]
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