2017-07-19 153 views
1

当我尝试创建我的代码timer.Simple我给出的这个错误:当创建一个timer.SImple它给了我错误的参数#2错误

bad argument #2 to 'Simple' (function expected, got no value) 

我已经找了很多不同的地方罚款答案,但无法找到任何解决办法。 代码:

http.Fetch("http://api.time-gaming.co.uk/lua-api.php?key="..ipsd.key.."&email="..ipsd.email.."&type=info", 
function(body, len, headers, code) 
    ipsd.initaldata = body 
    print("Checking Licence Key!") 
    print(ipsd.initaldata) 
    timer.Simple(2, activate()) 
end, 
function(error) 
    print("Failed to recive data from the web!") 
end 
) 
+0

尝试'timer.Simple(2,激活)' –

回答

1

要扩大EgorSkriptunoff的在评论中建议:要传递的结果activate调用timer.Simple(这可能不返回任何东西),但你想,而不是传递实际功能,因为这是定时器过期时将调用的功能。

使用timer.Simple(2, activate)应该产生你想要的结果。

+0

谢谢。这工作。 :) –

相关问题