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 » Scripters
Home Search
 

Re: Issues with Gmatch

Previous Thread :: Next Thread 
Rocketerkid is not online. Rocketerkid
Joined: 10 Oct 2011
Total Posts: 1237
20 Sep 2015 05:17 PM
I've never really used Gmatch, I've always just made my own inefficient way to not have to learn it. I may be using it completely wrong, but.


for w in string.gmatch(game.Lighting.TimeOfDay, "%p") do
print(w)
end

I was hoping to use this to return the Hour, Minute, and Second of the time.

Sadly I'm only getting the colons. How could I use this to return the Hour, Minute, and Second?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
20 Sep 2015 05:18 PM
%P+
Report Abuse
Rocketerkid is not online. Rocketerkid
Joined: 10 Oct 2011
Total Posts: 1237
20 Sep 2015 05:20 PM
I was using %p+ originally and it still returned the colons.

Though, it appears the %P+ fixed it. I don't see anywhere on the String Pattern page about the capitalized version. O.o
Report Abuse
Rocketerkid is not online. Rocketerkid
Joined: 10 Oct 2011
Total Posts: 1237
20 Sep 2015 05:20 PM
Thanks, Cnt. :P
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
20 Sep 2015 05:22 PM
Here, this will help:
http://www.lua.org/pil/20.2.html

Also: 'An upper case version of any of those classes represents the complement of the class.'
Report Abuse
Rocketerkid is not online. Rocketerkid
Joined: 10 Oct 2011
Total Posts: 1237
20 Sep 2015 05:23 PM
Oh! Thanks, Cnt. :)
Report Abuse
cpmody is not online. cpmody
Joined: 16 Aug 2015
Total Posts: 457
20 Sep 2015 05:45 PM
what does gmatch do, i forgot how to use most of the powerful string methods
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
20 Sep 2015 05:45 PM
An iterator that repeatedly matches.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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