I have a script that give actionid to an item, and i create that "movements" to read the actionid and send a magic effect when equip the weapon, but, idk how to read the weapon actionid, tried with the same item:getAttribute(ITEM_ATTRIBUTE_ACTIONID) and item.actionid but nothing happens, when i write one actionid works fine!
someone can help me?
someone can help me?
Lua:
local effects = {
[57000] = {effect = CONST_ME_MAGIC_BLUE},
[57001] = {effect = CONST_ME_MAGIC_RED},
[57002] = {effect = CONST_ME_MAGIC_GREEN},
[57003] = {effect = CONST_ME_MAGIC_BLUE},
[57004] = {effect = CONST_ME_MAGIC_BLUE},
[57005] = {effect = CONST_ME_GREEN_RINGS},
[57006] = {effect = CONST_ME_FIREAREA}
}
function onEquip(player, item, slot)
local Effects = effects[item:getAttribute(ITEM_ATTRIBUTE_ACTIONID)]
if item:getAttribute(ITEM_ATTRIBUTE_ACTIONID) == Effects then
player:getPosition():sendMagicEffect(Effects.effect)
end
return true
end
Last edited: