flaviiojr
Active Member
- Joined
- Jan 20, 2017
- Messages
- 230
- Solutions
- 13
- Reaction score
- 39
Is there a way the script returns the transform only if the target item is in the slot ring?
Example: if the target item is not in the ring slot, returns false, if the target item is in the ring slot returns transform


Example: if the target item is not in the ring slot, returns false, if the target item is in the ring slot returns transform
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local ring = player:getSlotItem(CONST_SLOT_RING)
if not ring then
return false
end
if target.itemid ~= 2357 and ring:getId() ~= 2357 then
return false
end
ring:transform(2123)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Congratulations!')
player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE)
item:remove()
return true
end