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
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 107 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 17 Feb 2015 07:08 PM |
| Sort of. You have to do something with the expression though. |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|