miens
Combos and Freedom
- Joined
- Nov 6, 2016
- Messages
- 61
- Reaction score
- 8
Hi!
In my ots I wanted to make a spell that would modify weapons attack value but only temporarily. So I Almost made it to work with
but then I need to take the bonus back after some time. So I decided to use addEvent for this.
And it was working fine. Until I realized that sever crashes if players logs out before the event fires. I suppose it is because I am referencing to item owned by player who is offline. In the event I added a simple if statement to check if player logged out after event was scheduled and if so the event did nothing. Server didnt crashed then but weapons attribute remained modified.
Does anyone have any idea how to for example modify the item back on player logout or login? Or maybe is there a way to change the item back even if it is held by offline player? Any help is appreciated.
In my ots I wanted to make a spell that would modify weapons attack value but only temporarily. So I Almost made it to work with
PHP:
weapon:setAttribute(ITEM_ATTRIBUTE_ATTACK, 100)
PHP:
local parameters = {weapon = wpn, attack = atk, pl = player}
addEvent(UndoStatMod,1500,parameters)
Does anyone have any idea how to for example modify the item back on player logout or login? Or maybe is there a way to change the item back even if it is held by offline player? Any help is appreciated.