adrianoswatt

FragsSys - onLook

May 28th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. local storage = 23112
  2.  
  3. function onLook(cid, thing, pos, dist)
  4.     if isPlayer(thing.uid) then
  5.         if thing.uid ~= cid then
  6.             getFrag = getPlayerStorageValue(thing.uid, storage)
  7.             if getFrag == -1 then
  8.                 setPlayerStorageValue(thing.uid, storage, 0)
  9.                 getFrag = 0
  10.             end
  11.             doPlayerSetSpecialDescription(thing.uid, "\n Total Frag: ["..getFrag.."]")
  12.         else
  13.             getFrag = getPlayerStorageValue(cid, storage)
  14.             if getFrag == -1 then
  15.                 setPlayerStorageValue(cid, storage, 0)
  16.                 getFrag = 0
  17.             end
  18.             local string = 'Your Total Frags are: ['..getFrag..'].'
  19.             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
  20.         end
  21.     end
  22. return true
  23. end
Advertisement
Add Comment
Please, Sign In to add comment