Jump to content

[LE] RegisterForSingleUpdate only run once, please help


Recommended Posts

Scriptname EquilibriumScript extends Quest  

MiscObject Property Gold001 Auto

Event OnInit(); 
     RegisterForSingleUpdate(1.0);
EndEvent

Event OnUpdate()
Debug.Notification("Hello, world!")
Game.GetPlayer().addItem(Gold001, 1)
EndEvent

sorry if my eng;lish bad,

i recently play this game again, and moding again, and after some time my skiill is seems lower, even i forget this script, this script is runing, but only once, any idea what i do wrong?

note : "hello world" only appear once,

and thanks fpr reading

Link to comment
Share on other sites

Well, of course it only runs once, you've used registerforSINGLEupdate once. Either use RegisterForUpdate or repeat the registering at the end of OnUpdate to chain them, like this:

Scriptname EquilibriumScript extends Quest 

MiscObject Property Gold001 Auto

Event OnInit();
     RegisterForSingleUpdate(1.0);
EndEvent

Event OnUpdate()
Debug.Notification("Hello, world!")
Game.GetPlayer().addItem(Gold001, 1)
RegisterForSingleUpdate(1.0);
EndEvent
Edited by FrankFamily
Link to comment
Share on other sites

 

Well, of course it only runs once, you've used registerforSINGLEupdate once. Either use RegisterForUpdate or repeat the registering at the end of OnUpdate to chain them, like this:

Scriptname EquilibriumScript extends Quest 

MiscObject Property Gold001 Auto

Event OnInit();
     RegisterForSingleUpdate(1.0);
EndEvent

Event OnUpdate()
Debug.Notification("Hello, world!")
Game.GetPlayer().addItem(Gold001, 1)
RegisterForSingleUpdate(1.0);
EndEvent

ah thanks a lot, that will clear my problem, thanks again

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...