Ok so I am pretty new at this stuff and need a wee bit of help getting myself sorted out. What I am trying to do is see if my target gets up and only my target.
so my trigger reads thusly: ^(\w+) stands up and stretches (his|her) arms out wide\.$
and my script is:
if matches[2] == target then
echo("TARGET IS UP")
end
If you can help it would be greatly appreciated
Basic trigger script
Re: Basic trigger script
Help with what? What's it doing wrong?
Re: Basic trigger script
It's not echoing the target is up, my target stands up and nothing happens and I am not quite sure why
Re: Basic trigger script
It can be a number of factors; I'm afraid the information you've provided is a little sparse. I'm willing to bet, though, that your targets are input lowercase, and the trigger is, of course, checking for a proper-cased name. Try string.lower(matches[2]).
Re: Basic trigger script
Also, I usually go for a "try to find the target string anywhere in matches[2]", with a string.find(matches[2],target). Putting it together would look like:
string.find(string.lower(matches[2]),target)
This returns true (actually the start and end position) if the target string can be found anywhere in the matches[2] string.
string.find(string.lower(matches[2]),target)
This returns true (actually the start and end position) if the target string can be found anywhere in the matches[2] string.