Reputation: 25
When I try to create a timer.Simple in my code I am given this error:
bad argument #2 to 'Simple' (function expected, got no value)
I have looked for many different places to fine the answer but couldnt find anything to fix this. the code:
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
)
Upvotes: 1
Views: 490
Reputation: 26794
To expand on EgorSkriptunoff's suggestion in the comments: you are passing the result of the activate
call to timer.Simple
(which probably doesn't return anything), but you want instead to pass the actual function as this is what will be called by the timer when it expires.
Using timer.Simple(2, activate)
should produce the result you want.
Upvotes: 1