Advertisement
Guest User

shooting.lua (action

a guest
Apr 16th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. function onUse(cid, item, fromPosition, target, toPosition, isHotkey)
  2. local playerPos = getPlayerPosition(cid)
  3. if player:getStorageValue(Storage.BigfootBurden.Shooting) < 6 then
  4. local pos = Position(playerPos.x, playerPos.y - 5, 10)
  5. local tile = Tile(pos)
  6. if tile:getItemById(18226) then
  7. player:setStorageValue(Storage.BigfootBurden.Shooting, player:getStorageValue(Storage.BigfootBurden.Shooting) + 1)
  8. player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Hit!")
  9. tile:getItemById(18226):remove()
  10. pos:sendMagicEffect(CONST_ME_FIREATTACK)
  11. for i = 2, 4 do
  12. Position(playerPos.x, playerPos.y - i, 10):sendMagicEffect(CONST_ME_TELEPORT)
  13. end
  14. elseif tile:getItemById(18227) then
  15. player:setStorageValue(Storage.BigfootBurden.Shooting, player:getStorageValue(Storage.BigfootBurden.Shooting) < 1 and 0 or player:getStorageValue(Storage.BigfootBurden.Shooting) - 1)
  16. tile:getItemById(18227):remove()
  17. pos:sendMagicEffect(CONST_ME_FIREATTACK)
  18. for i = 2, 4 do
  19. Position(playerPos.x, playerPos.y - i, 10):sendMagicEffect(CONST_ME_TELEPORT)
  20. end
  21. end
  22. end
  23. return true
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement