Shadowman321
Member
- Joined
- Mar 27, 2010
- Messages
- 205
- Reaction score
- 22
Test script with addEvent:
Errors:
In game:
Can someone explain me some things with it?
First: Why it works even with error "Couldn't execute event"? And why it does not work first time?
Second: What is correct form of use:
PHP:
function onThink(interval, lastExecution)
doBroadcastMessage("Started", MESSAGE_EVENT_ADVANCE)
addEvent(spawn, 2 *1000)
function spawn()
doBroadcastMessage("It works!", MESSAGE_EVENT_ADVANCE)
end
end
> Broadcasted message: "Started".
[Error - GlobalEvent Interface]
data/globalevents/scripts/test.luanThink
Description:
(luaAddEvent) Callback parameter should be a function.
[Error - GlobalEvents::think] Couldn't execute event: a
> Broadcasted message: "Started".
[Error - GlobalEvents::think] Couldn't execute event: a
> Broadcasted message: "It works!".
> Broadcasted message: "Started".
[Error - GlobalEvents::think] Couldn't execute event: a
> Broadcasted message: "It works!".
In game:
04:52 Started
04:52 Started
04:52 It works!
04:53 Started
04:53 It works!
Can someone explain me some things with it?
First: Why it works even with error "Couldn't execute event"? And why it does not work first time?
Second: What is correct form of use:
addEvent(spawn, 2 *1000)
function spawn()
Last edited: