Guest User

Untitled

a guest
May 20th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. Begin SlaughterfishClub
  2.  
  3. short OnPCEquip
  4. long MyCondition
  5. short timer
  6.  
  7. if ( OnPCEquip != 1 )
  8. return
  9. endif
  10.  
  11.  
  12. ;No sense in running the script every frame when item is equipped.
  13. ;Every five frames ought to be enough as it's still way less than a second
  14.  
  15. set timer to ( timer + 1 )
  16.  
  17. if ( timer < 5 )
  18. return
  19. endif
  20.  
  21. set timer to 0
  22.  
  23.  
  24. ;When detecting condition of the item it is possible that item breaks
  25. ;so fast the script can't keep up. If this happens raise the number below
  26. setx MyCondition to xGetCondition
  27.  
  28.  
  29. if ( MyCondition <= 20 )
  30. Startscript "RemoveSlaughterfishClub" ;Removing the club through a separate script
  31. return
  32. Set PCEquip to 0
  33. endif
  34.  
  35.  
  36.  
  37. ///////////////////////////////////////
  38.  
  39.  
  40. Begin RemoveSlaughterfishClub
  41.  
  42. short timer
  43.  
  44.  
  45.  
  46. set timer to ( timer + 1 )
  47.  
  48. if ( timer < 2 )
  49. return
  50. endif
  51.  
  52. set Timer to 0
  53. player->removeitem SlaughterfishClub 1
  54. Stopscript "RemoveSlaughterfishClub"
  55.  
  56. end
Add Comment
Please, Sign In to add comment