roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,210
- Solutions
- 35
- Reaction score
- 207
I'm creating an item where the player opens the paper, and writes something, he looses hp (deathnoe).
So i use function "onTextEdit", like this.
but i need to register on login.lua
to avoid registering at all, I wanted to register only those who open the item. Like this in actions:
but every time he opens the paper, it will be registred, can this cause an error or lag? If you register multiple times on the same player for example
So i use function "onTextEdit", like this.
LUA:
function onTextEdit(cid, item, newText)
if item.actionid == 9202 then
doCreatureAddHealth(getCreatureByName(newText), -250)
end
return TRUE
end
but i need to register on login.lua
Code:
registerCreatureEvent (cid, "DeathNote")
to avoid registering at all, I wanted to register only those who open the item. Like this in actions:
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 15811 then
player:registerEvent("DeathNote")
end
return false
end
but every time he opens the paper, it will be registred, can this cause an error or lag? If you register multiple times on the same player for example