Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. local helmet =
  2. {
  3. [id] = toId,
  4. }
  5.  
  6. function onUse(creature, item, position, fromPosition, pos, target, toPosition)
  7. if (not target:isCreature()) then
  8. local toId = helmet[item:getId()]
  9. if (toId) then
  10. target:transform(toId)
  11. item:remove(1)
  12. return true
  13. end
  14. end
  15.  
  16. local player = creature:getPlayer()
  17. local tilepos1 = {x=32910, y=32339, z=15}
  18. local tilepos2 = {x=32911, y=32339, z=15}
  19. local tilepos3 = {x=32910, y=32338, z=15}
  20. local tilepos4 = {x=32911, y=32338, z=15}
  21. if not player then
  22. return
  23. end
  24. 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
  25. player:removeItem(2147, 1)
  26. player:teleportTo(Position(33586,32263, 7))
  27. player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
  28. return true
  29. end
  30. return true
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement