V
tfs 1.5?this don't work
local ITEM_ID = 44272 -- Item ID that the player can click to add auras
local STORAGE_KEY = 941002 -- Unique storage key for tracking usage
local STORAGE_VALUE = 90700 -- Specific storage value to set
local addAuraSystem = Action()
function addAuraSystem.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid ~= ITEM_ID then
return true
end
if player:getStorageValue(STORAGE_KEY) == 1 then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You have already used this item.")
return true
end
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have received an aura with storage: " .. STORAGE_VALUE .. ".")
player:setStorageValue(STORAGE_KEY, 1)
player:setStorageValue(STORAGE_VALUE, 1)
item:remove(1)
return true
end
addAuraSystem:id(ITEM_ID)
addAuraSystem:register()
Did you add your aura STORAGE_VALUE ?nope don't work
exactly xdthats missing a function player:addAura(id) no? storage its just random think that check if item been used?
I don't seem to have that addWing or addWings function. I need to add this part in the source in lucasript.cpp and lucasscript.h.
LUA:Lua Script Error: [Action Interface] data/actions/scripts/roupa.lua:onUse data/actions/scripts/roupa.lua:16: attempt to call method 'addWing' (a nil value) stack traceback: [C]: in function 'addWing' data/actions/scripts/roupa.lua:16: in function <data/actions/scripts/roupa.lua:1>
registerClass("Monster", "Creature", LuaScriptInterface::luaMonsterCreate);
registerMethod("Player", "addAura"...