Advertisement
dalvorsn

Guild door

Feb 18th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. function onUse(cid, item, frompos, item2, topos)
  2.     local guildName, pos = getItemAttribute(item.uid, "description"):match("Lugar da guild: (.+)."), getThingPos(item.uid)
  3.     if(item.aid == 0)then -- /\
  4.         pos.x = pos.x + 2
  5.     elseif(item.aid == 1)then -- \/
  6.         pos.x = pos.x -2
  7.     elseif(item.aid == 2)then -- >
  8.         pos.y = pos.y + 2
  9.     elseif(item.aid == 3)then -- <
  10.         pos.y = pos.y - 2
  11.     end
  12.     if(guildName == getPlayerGuildName(cid))then
  13.         doTeleportThing(cid, pos, false) -- esse false e pro pushMove, ou seja, false para nao parecer que ele esta sendo puxado
  14.         doCreatureSay(cid, "Welcome Guildmember!", TALKTYPE_ORANGE_1)
  15.     else
  16.         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but you're not in this guild.")
  17.         return false
  18.     end
  19.  
  20. return true
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement