Also, B is not defined when A is defined, so you’re not likely to have both functions get called.
Further, to call a function an infinite number of times using a timer you simply put 0 as the third parameter. You are risking memory problems to do the recursion yourself.
Actually, I want to call firstly function A with delay of time=100 then call the same function with each delay of time=5000. Thats why I was doing this. Can you please suggest me something regarding this?
Hmm, I entirely expected B not to be defined because I believe it is a “forward reference” which should be null. However, this is only true for local variables - which these functions are not.
Anyway, if you want A called after 100 milliseconds and then B called every 5000 milliseconds, you should do this (I have also adjusted the code to be local and to resolve the forward reference):
local function B() print("'ello B") end local function A() print("Hello A") timer.performWithDelay(500, B, 0) end timer.performWithDelay(100, A, 1)
Also, B is not defined when A is defined, so you’re not likely to have both functions get called.
Further, to call a function an infinite number of times using a timer you simply put 0 as the third parameter. You are risking memory problems to do the recursion yourself.
Actually, I want to call firstly function A with delay of time=100 then call the same function with each delay of time=5000. Thats why I was doing this. Can you please suggest me something regarding this?
Hmm, I entirely expected B not to be defined because I believe it is a “forward reference” which should be null. However, this is only true for local variables - which these functions are not.
Anyway, if you want A called after 100 milliseconds and then B called every 5000 milliseconds, you should do this (I have also adjusted the code to be local and to resolve the forward reference):
local function B() print("'ello B") end local function A() print("Hello A") timer.performWithDelay(500, B, 0) end timer.performWithDelay(100, A, 1)