Guest User

Untitled

a guest
Sep 13th, 2024
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. #{_player}=攻撃者
  2. #{_radious}=最大射程
  3. #{_trueyaw}=yaw範囲
  4. #{_uppitch}=pitchの上の範囲
  5. #{_downpitch}=pitchの下の範囲
  6. #{_basedmg}基礎ダメージ
  7. #{_critdmg}=CritDmg
  8. #{_critmaxlength}=Crit最大射程
  9. #{_critminlength}=Crit最短射程
  10. #※ここでのCritは確率ではなく最もダメージが出せる距離でのダメージ補正
  11. #{_critsound}=Crit音
  12. #{_critpitchofs}=Crit音のPitch
  13.  
  14. on right click with iron axe:
  15. atk(player ,6 ,20 ,7 ,25 ,12 ,8 ,5 ,4.5 ,"entity.player.attack.crit" ,2 ,6 ,crit ,1 ,5 ,2 ,0.3 ,"entity.player.attack.sweep" ,1 ,1 ,10)
  16.  
  17. function atk(player:player ,radious:number ,trueyaw:number ,uppitch:number ,downpitch:number ,basedmg:number ,critdmg:number ,critmaxlength:number ,critminlength:number ,critsound:string ,critpitchofs:number ,CD:number ,partype:particle ,paramo:number ,parextra:number ,delay:number ,delayendoffrontpush:number ,sound:string ,soundpitch:number ,next:number ,nextwait:number):
  18. loop entities in radius {_radious} around {_player}:
  19. loop-entity is not {_player}
  20. living(loop-entity) is set
  21. set {_vec} to vector from {_player} to loop-entity
  22. set {_yaw} to yaw of {_vec}
  23. set {_pitch} to pitch of {_vec}
  24. set {_pitchup} to {_pitch} - {_uppitch}
  25. set {_pitchdown} to {_pitch} + {_downpitch}
  26. set {_pitchupnear} to {_pitch} - 60
  27. set {_pitchdownnear} to {_pitch} + 60
  28. set {_yawcheck} to yaw of {_player}
  29. set {_yawcheck} to {_yawcheck} - {_yaw}
  30. if {_yawcheck} < 0:
  31. set {_yawcheck} to {_yawcheck} * -1
  32. set {_lim} to 360 - {_trueyaw}
  33. if {_yawcheck} >= {_lim}:
  34. set {_yawcheck} to 360 - {_yawcheck}
  35. if distance between {_player} and loop-entity <= 2.5:
  36. if distance between {_player} and loop-entity <= 1.5:
  37. set {_pitchupnear} to {_pitch} - 90
  38. set {_pitchdownnear} to {_pitch} + 90
  39. pitch of {_player} is between {_pitchdownnear} and {_pitchupnear}
  40. {_yawcheck} is between 0 and 60
  41. set {_ok} to 1
  42. else:
  43. pitch of {_player} is between {_pitchdown} and {_pitchup}
  44. {_yawcheck} is between 0 and {_trueyaw}
  45. set {_ok} to 1
  46. {_ok} is set
  47. if distance between {_player} and loop-entity >= {_critminlength}:
  48. distance between {_player} and loop-entity <= {_critmaxlength}
  49. set {_ce} to 1
  50. if {_ce} is set:
  51. play sound "%{_critsound}%" with volume 1 and pitch {_critpitchofs} at {_player}
  52. make 20 of block particle using nether wart block at block 1 meters above loop-entity
  53. make {_player} damage loop-entity by ({_basedmg} + {_critdmg})
  54. else:
  55. make {_player} damage loop-entity by {_basedmg}
Advertisement
Add Comment
Please, Sign In to add comment