Advertisement
Guest User

CombatLog for Bedr0ckPVP

a guest
Apr 2nd, 2021
330
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Thank you for using my Skript for your request!
  2. # In the configuration you can change anything you want.
  3.  
  4. # CONFIG:
  5. options:
  6. # Prefix: This will be used for pretty much every message
  7. # Make sure to have no space after the Prefix!
  8. Prefix: &d&lBedr0ck&5&lPVP &8>>
  9.  
  10. # If set to true, escape commands will be disabled while combat logged.
  11. CommandsDisable: true
  12.  
  13. # Gets warned as they leave whilst Combat Logged:
  14. WarnOnLeave: true
  15.  
  16. # Gets /killed upon join after Combat Logging:
  17. KillOnJoin: true
  18.  
  19. # Messages
  20. # Message as they get killed upon joining:
  21. JoinKilledMsg: &cSince you combat logged you have been /killed
  22.  
  23. # Message if player got hit by another player:
  24. HittedMsg: &cYou have been combat tagged for 10 seconds by
  25. # You can use %attacker% and %victim% for this:
  26. HittedMsg2: &e(%attacker%)! &4Do not log out
  27.  
  28. # Message if player hits another player:
  29. HittingMsg: &cYou have been combat tagged for 10 seconds by
  30. HittingMsg2: &e(%attacker%)! &4Do not log out
  31. HittingMsg3: &cYou are attacking &e(%victim%) &cDo not log out!
  32.  
  33. # Message once they are out of the Combat Log:
  34. CombatOverMsg: &aYou are no longer in combat. You may log out or /spawn
  35.  
  36. # Combat Log Bypass Permission:
  37. CLBypassPerm: combatlog.bypass
  38.  
  39.  
  40. # The code starts here!
  41. # Please only change it, if you know what you are doing!
  42. on quit:
  43. {CL::%uuid of player%::in.combat} is true
  44.  
  45. if {@WarnOnLeave} is true:
  46. execute console command "warn %event-player% Combat Log"
  47. delete {CL::%uuid of player%::*}
  48. set {CombatLogged::%uuid of player%} to true
  49.  
  50. on command:
  51. {CL::%uuid of player%::in.combat} is true
  52. if {@CommandsDisable} is true:
  53. command is "spawn" or "warp" or "tp" or "tpa" or "tpaccept" or "tpahere" or "back" or "home" or "world" or "god" or "gamemode"
  54. message "&cYou cant do that while Combat Logged!"
  55.  
  56. on damage:
  57. victim is a player
  58. attacker is a player
  59. attacker is not the victim
  60. if victim has permission "{@CLBypassPerm}":
  61. stop
  62. else:
  63. if {CL::%uuid of victim%::in.combat} is true:
  64. set {CL::%uuid of victim%::in.seconds.until.out} to 10
  65. stop
  66. send "{@Prefix} {@HittedMsg}" to victim
  67. send "{@Prefix} {@HittedMsg2}" to victim
  68. set {CL::%uuid of victim%::in.combat} to true
  69. set {CL::%uuid of victim%::in.seconds.until.out} to 10
  70. while {CL::%uuid of victim%::in.seconds.until.out} is more than 1:
  71. {CL::%uuid of victim%::in.seconds.until.out} is not set:
  72. stop
  73. subtract 1 from {CL::%uuid of victim%::in.seconds.until.out}
  74. wait 1 second
  75. delete {CL::%uuid of victim%::in.combat}
  76. delete {CL::%uuid of victim%::in.seconds.until.out}
  77. send "{@Prefix} {@CombatOverMsg}" to victim
  78.  
  79. on death:
  80. delete {CL::%uuid of event-player%::in.combat}
  81. delete {CL::%uuid of event-player%::in.seconds.until.out}
  82.  
  83. on damage:
  84. victim is a player
  85. attacker is a player
  86. attacker is not the victim
  87. if {CL::%uuid of attacker%::in.combat} is true:
  88. set {CL::%uuid of attacker%::in.seconds.until.out} to 10
  89. stop
  90. send "{@Prefix} {@HittingMsg}" to attacker
  91. send "{@Prefix} {@HittingMsg2}" to attacker
  92. send "{@Prefix} {@HittingMsg3}" to attacker
  93. set {CL::%uuid of attacker%::in.combat} to true
  94. set {CL::%uuid of attacker%::in.seconds.until.out} to 10
  95. while {CL::%uuid of attacker%::in.seconds.until.out} is more than 1:
  96. {CL::%uuid of attacker%::in.seconds.until.out} is not set:
  97. stop
  98. subtract 1 from {CL::%uuid of attacker%::in.seconds.until.out}
  99. wait 1 second
  100. delete {CL::%uuid of attacker%::in.combat}
  101. delete {CL::%uuid of attacker%::in.seconds.until.out}
  102. send "{@Prefix} {@CombatOverMsg}" to attacker
  103.  
  104. on join:
  105. delete {CL::%uuid of event-player%::*}
  106. if {CombatLogged::%uuid of event-player%}:
  107. if {@KillOnJoin} is true:
  108. wait 1 second
  109. execute console command "/kill %event-player%"
  110. send "{@Prefix} {@JoinKilledMsg}"
  111. delete {CombatLogged::%uuid of event-player%}
  112.  
  113. on script load:
  114. delete {CL::*}
  115.  
Advertisement
RAW Paste Data Copied
Advertisement