timer.delay(3, false, function (self, handle, time_elapsed)
print("hello")
self.enemy_damage = false
end)
In the code above it should print hello and change the varialbe self.enemy_damage to true after 3 seconds. But when executed it returns:
for context: the timer.delay function is on line 145 and it is called by a line of code at line 159
I know that if a nil value is returned it means that i have put the wrong thing into the timer.delay function like a string instead of a intager. I’ve messed around with it for a while by changing the delay which in the code snippet is 3 to 3.0, and “three” but i got the same error. I also tried assigning the function as a variable but it didn’t seem to change anything. I’ve read the documentation API reference (timer) but couldn’t find anything to help me source the error. Do i need to import anthing or write any code before the timer.delay function can operate?
Also many thanks to Mathias_Westerdahl for helping me navigate setting the function up