Advertisement
poxipox

Untitled

Mar 11th, 2023
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1.  
  2.  
  3. function onTargetTile_1(cid, pos)
  4. local target = getTopCreature(pos)
  5. if target.itemid > 0 and isPlayer(target.uid) then
  6. target = target.uid
  7. local addStun = false
  8. if not playerStunAdd[cid] or (playerStunAdd[cid] and playerStunAdd[cid] < os.time()) then
  9. addStun = true
  10. end
  11.  
  12. if addStun and (not playerStunGet[target] or (playerStunGet[target] and playerStunGet[target] < os.time())) then
  13. doCreatureSetNoMove(target, true)
  14. playerStunGet[cid] = os.time() + nextStunTimeCanGet
  15. addEvent(removeStun, stunTime*1000, target)
  16. doPlayerSendTextMessage(target, MESSAGE_STATUS_DEFAULT, 'Stuned!!')
  17.  
  18. else
  19. addStun = false
  20. end
  21.  
  22. if addStun then
  23. playerStunAdd[cid] = os.time() + nextStunTimeCanAdd
  24. end
  25.  
  26. end
  27. end
  28. return true
  29. end
  30.  
  31.  
  32. setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile_1")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement