Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. local c = {
  2.     tempo = 45, -- Em segundos ficará PZ e Skull
  3. }
  4.  
  5. local condition_infight = createConditionObject(CONDITION_INFIGHT)
  6. setConditionParam(condition_infight, CONDITION_PARAM_TICKS, -1)
  7.  
  8. function onAttack(cid, target)
  9.     if not isPlayer(cid) or not isPlayer(target) then
  10.         return true
  11.     end
  12.     if  getCreatureSkullType(cid) == false then
  13.         if getCreatureSkullType(target) >= SKULL_WHITE then
  14.             doCreatureSetSkullType(cid, SKULL_YELLOW)
  15.             doAddCondition(cid, condition_infight)
  16.             doPlayerSetPzLocked(cid, true)
  17.             addEvent(function()
  18.                 doRemoveCondition(cid, CONDITION_INFIGHT)
  19.                 doCreatureSetSkullType(cid, SKULL_NONE)
  20.                 doPlayerSetPzLocked(cid, false)
  21.             end, c.tempo * 1000)
  22.         end
  23.     end
  24. return true
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement