Skymagnum

Untitled

Jun 6th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. function chooseSpec(uid)
  2.  
  3. if(not isCreature(uid) or #getPlayersOnline() == 0) then
  4.     return true
  5. end
  6.  
  7. local random = getPlayersOnline()[math.random(#getPlayersOnline()]
  8.  
  9. if(getPlayerStorageValue(uid, 38290) < 1) then
  10.     return setPlayerStorageValue(uid, 38290, random)
  11. end
  12. local player = getPlayerStorageValue(uid, 38290)
  13.  
  14. if getThingPos(uid).x ~= getThingPos(player).x and getThingPos(uid).y ~= getThingPos(player).y then
  15.     doTeleportThing(uid, getCreaturePosition(online[math.random(#online)]))
  16.     doCreatureAddHealth(uid, 65550, true)
  17.     doSetCreatureOutfit(uid, {lookType = 0}, -1)
  18.     doCreatureSetHideHealth(uid, true)
  19.     mayNotMove(uid, true)
  20. end
  21.     return addEvent(chooseSpec, 1000, uid)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment