• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved How to get Player() userdata registered events in LUA? [TFS 1.x]

whitevo

Feeling good, thats what I do.
Joined
Jan 2, 2015
Messages
3,454
Solutions
1
Reaction score
627
Location
Estonia
Do I have to create global table to keep track of what events I have registrated on player?

Because all I found was:
MonsterType:getCreatureEvents()

Might anything bad happen if do this?
player:registerEvent(debuff)
on EACH hit player takes?
 
Do I have to create global table to keep track of what events I have registrated on player?

Because all I found was:
MonsterType:getCreatureEvents()

Might anything bad happen if do this?
player:registerEvent(debuff)
on EACH hit player takes?

You can open up an issue to get that function added, would probbly be better.
As of right now you can do one of 2 things, either use a storage value (that you reset at onLogout etc) or this: https://github.com/otland/forgottenserver/blob/master/src/luascript.cpp#L2060-L2061
 
You can open up an issue to get that function added, would probbly be better.
As of right now you can do one of 2 things, either use a storage value (that you reset at onLogout etc) or this: https://github.com/otland/forgottenserver/blob/master/src/luascript.cpp#L2060-L2061
you mean its better to:
player:unregisterEvent(debuff)
player:registerEvent(debuff)
on each hit player takes.

instead of
player:registerEvent(debuff)
on each hit player takes.

?

As of right now you can do one of 2 things, either use a storage value
MY GOD, dumb me >.> lol, been using too much unified tables what generate storage values to monsters. Forgot players just have this...
 
you mean its better to:
player:unregisterEvent(debuff)
player:registerEvent(debuff)
on each hit player takes.

instead of
player:registerEvent(debuff)
on each hit player takes.

?


MY GOD, dumb me >.> lol, been using too much unified tables what generate storage values to monsters. Forgot players just have this...

Well that is just my guess, I have never had to do anything like this.
Only times ive had to register events is in games and events = you got a start and an end.

It will either overwrite (use just registerEvent) or it will create a new one (use unregister first).

xD

Edit:
@whitevo You got me the 500th like .p
 
Last edited:

Similar threads

Back
Top