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: String help

Previous Thread :: Next Thread 
Avocation is not online. Avocation
Joined: 22 Mar 2011
Total Posts: 107
17 Feb 2015 06:54 PM
how would you detect if somewhere in a text value there is a term like say Hot Chocolate w/ MM (C). Would you be able to have a script see that it has (C) in it without know the exact location of it?
Report Abuse
Avocation is not online. Avocation
Joined: 22 Mar 2011
Total Posts: 107
17 Feb 2015 06:59 PM
bump
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
17 Feb 2015 07:02 PM
local str = "Hot Chocolate w/ MM (C)"

str:match("%(C%)") == "(C)"

This will evaluate to true if (C) exists in the string.
Report Abuse
Avocation is not online. Avocation
Joined: 22 Mar 2011
Total Posts: 107
17 Feb 2015 07:05 PM
So if it a tool that touched am object you would do

str = hit.Parent.Name

str:match("%(C%)") == "(C)"
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
17 Feb 2015 07:08 PM
Sort of. You have to do something with the expression though.
Report Abuse
Avocation is not online. Avocation
Joined: 22 Mar 2011
Total Posts: 107
17 Feb 2015 07:12 PM
so how would i do this in an if thing so like
if blablabla then
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
17 Feb 2015 08:29 PM
Yes.
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