Advertisement
Guest User

Untitled

a guest
Dec 14th, 2011
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.00 KB | None | 0 0
  1. -- orshabaal lever
  2.  
  3. function onUse(cid, item, frompos, item2, topos)
  4.  
  5.     if item.uid == 7004  and item.itemid == 1945 then
  6.   player1pos = {x=107, y=506, z=8, stackpos=253}
  7.   player1 = getThingfromPos(player1pos)
  8.  
  9.   player2pos = {x=106, y=506, z=8, stackpos=253}
  10.   player2 = getThingfromPos(player2pos)
  11.  
  12.   player3pos = {x=105, y=506, z=8, stackpos=253}
  13.   player3 = getThingfromPos(player3pos)
  14.  
  15.   player4pos = {x=104, y=506, z=8, stackpos=253}
  16.   player4 = getThingfromPos(player4pos)
  17.  
  18.  
  19.   if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
  20.   queststatus1 = getPlayerStorageValue(player1.uid,7004)
  21.   queststatus2 = getPlayerStorageValue(player2.uid,7004)
  22.   queststatus3 = getPlayerStorageValue(player3.uid,7004)
  23.   queststatus4 = getPlayerStorageValue(player4.uid,7004)
  24.  
  25.   if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then
  26.     nplayer1pos = {x=107, y=506, z=9}
  27.     nplayer2pos = {x=106, y=506, z=9}
  28.     nplayer3pos = {x=105, y=506, z=9}
  29.     nplayer4pos = {x=104, y=506, z=9}
  30.  
  31.     doSendMagicEffect(player1pos,2)
  32.     doSendMagicEffect(player2pos,2)
  33.     doSendMagicEffect(player3pos,2)
  34.     doSendMagicEffect(player4pos,2)
  35.  
  36.     doTeleportThing(player1.uid,nplayer1pos)
  37.     doTeleportThing(player2.uid,nplayer2pos)
  38.     doTeleportThing(player3.uid,nplayer3pos)
  39.     doTeleportThing(player4.uid,nplayer4pos)
  40.  
  41.     doSendMagicEffect(nplayer1pos,10)
  42.     doSendMagicEffect(nplayer2pos,10)
  43.     doSendMagicEffect(nplayer3pos,10)
  44.     doSendMagicEffect(nplayer4pos,10)
  45.  
  46.     doTransformItem(item.uid,item.itemid+1)
  47.   else
  48.     doPlayerSendCancel(cid,"Somebody in your team has already done this quest.")
  49.   end
  50.   else
  51.   doPlayerSendCancel(cid,"You need four players four this quest.")
  52.   end
  53.  
  54. elseif item.uid ==7004 and item.itemid == 1946 then
  55.   if getPlayerAccess(cid,1) then
  56.   doTransformItem(item.uid,item.itemid-1)
  57.   else
  58.   doPlayerSendCancel(cid,"Sorry, not possible.")
  59.   end
  60. else
  61.   return 0
  62. end
  63.  
  64. return 1
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement