2017-07-19 73 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

謝謝。這工作。 :) –

相關問題