string.match

Posted by Kaye on Sun 29 Jul 2007 04:26 AM — 2 posts, 11,269 views.

#0
I'm trying to do a LUA conditional on string.match in MUSHClient. As in:

if string.match("THIS", "HI") ~= nil then
world.Note("WHEE")
end

This gives me the error message:

[string "Script file"]:6: attempt to call field `match' (a nil value)

What am I doing wrong? Do I not have the string library somehow? If that's the case, how do I get it?
Australia Forum Administrator #1
You will automatically have the string library. Can you copy and paste the entire script up to the point of the error? The lines you pasted can't be line 6, which is the line given in the error message (unless there was something beforehand).