
The cause is always to return a value of 0 when counting the number of power switches, and then found that the function string.find problem, sometimes can not return the correct result when encountering a hyphen
Code: Select all
/c local a = string.find("power-switch", "power%-switch") game.print(a)