-1
我从来没有与lua工作过,并且很难弄清楚如何根据与通配符匹配的字符串匹配返回一个值......预先感谢您的任何帮帮我。lua - 如果字符串匹配通配符,返回值
这里是脚本我负责修改。我正在寻找Bob *的最后一点是我被卡住的地方。
if score < 3000 then
return 180
end
if score > 2999 and score < 10000 then
return 90
end
if score > 9999 and score < 25000 then
return 30
end
if score > 24999 then
return 7
end
if name = string.match(name, 'Bob*')
return 0
end
;
标准通配符'?'和'*'在Lua中看起来像这样:'.'和'。*'正确的语法是'if string.match(name,'^ Bob。* $')then return 0 end' –
帮你一个忙,阅读Lua的参考和/或在Lua编程,或者至少做一些教程......你缺乏Lua语法的基础知识。 – Piglet