Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local helmet =
- {
- [id] = toId,
- }
- function onUse(creature, item, position, fromPosition, pos, target, toPosition)
- if (not target:isCreature()) then
- local toId = helmet[item:getId()]
- if (toId) then
- target:transform(toId)
- item:remove(1)
- return true
- end
- end
- local player = creature:getPlayer()
- local tilepos1 = {x=32910, y=32339, z=15}
- local tilepos2 = {x=32911, y=32339, z=15}
- local tilepos3 = {x=32910, y=32338, z=15}
- local tilepos4 = {x=32911, y=32338, z=15}
- if not player then
- return
- end
- if player:getItemCount(2147) >= 1 and pos.x == tilepos1.x or pos.x == tilepos2.x and pos.y == tilepos1.y or pos.y == tilepos3.y and pos.z == tilepos1.z then
- player:removeItem(2147, 1)
- player:teleportTo(Position(33586,32263, 7))
- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
- return true
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement