1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I need your opinions. Which skript of combattag is better?

Discussion in 'Skript' started by Proting, Apr 8, 2018.

Thread Status:
Not open for further replies.
  1. Proting

    Proting Member

    Joined:
    Feb 11, 2017
    Messages:
    10
    Likes Received:
    0
    I'm trying to make a good combattag skript and I have 3 ways, what do you think? or can you help me improve the script?

    1.
    Code (Skript):
    1. on damage of player:
    2.     set {combattag.%attacker%} to true
    3.     send "&cNow you have combattag."
    4.     wait 15 seconds
    5.     set {combattag.%attacker%} to true
    6.     send "&aNow you have no combattag."
    7.    
    8. on command:
    9.     {combattag.%player%} is true
    10.     cancel event
    11.     send "&cYou have combattag."
    12.    
    13. on quit:
    14.     {combattag.%player%} is true
    15.     kill player
    16.     set {combattag.%player} to false
    17.    
    18. on join:
    19.     set {combattag.%player%} to false
    2.
    Code (Skript):
    1. on damage of player:
    2.     set {_time} to difference between {combattag.%player%} and now
    3.    
    4. on command:
    5.     if {_time} is less than 15 seconds:
    6.         send "&cYou have combattag."
    7.         cancel event
    8.         stop
    9.     set {combattag.%player%} to now
    10.    
    11. on quit:
    12.     if {_time} is less than 15 seconds:
    13.         kill player
    14.         stop
    15.     set {combattag.%player%} to now
    16.    
    17. on join:
    18.     delete {_time}
    3.
    Code (Skript):
    1. on damage of player:
    2.     if {combattag::%player%} is not set:
    3.         set {combattag::%player%} to now
    4.         stop
    5.     set {_time} to difference between {combattag::%player%} and now
    6.    
    7. on command:
    8.     if {_time} is less than 15 seconds:
    9.         cancel event
    10.         set {_combattag} to 15 seconds
    11.         subtract {_time} from {_combattag}
    12.         send "&cYou have %{_combattag}% of combattag." to player
    13.     else:
    14.         set {combattag.%player%} to now
    15.        
    16. on quit:
    17.     if {_time} is less than 15 seconds:
    18.         kill player
    19.         set {_combattag} to 15 seconds
    20.         subtract {_time} from {_combattag}
    21.     else:
    22.         set {combattag.%player%} to now
    23.        
    24. on join:
    25.     delete {_time}
     
  2. OrangeCanadian

    OrangeCanadian Active Member

    Joined:
    Aug 2, 2017
    Messages:
    72
    Likes Received:
    0
    This Forums section is to parse and fix you're scripts. Consider using the CombatTag to find out.

    Next time please use proper format. Otherwise set this to SOLVED and post this on another section.
     
  3. Proting

    Proting Member

    Joined:
    Feb 11, 2017
    Messages:
    10
    Likes Received:
    0
    in what section do I publish it and how do I put it in solved?
     
  4. OrangeCanadian

    OrangeCanadian Active Member

    Joined:
    Aug 2, 2017
    Messages:
    72
    Likes Received:
    0
    Click Thread Tools and change the prefix.

    And post this is requests.
     
  5. CharcoalToast

    CharcoalToast Member

    Joined:
    Mar 10, 2018
    Messages:
    21
    Likes Received:
    4
    The second and the thirth combattag is not going to work, and in the first one you made a mistake. You have to set the combattag after 15 sec to false, not to true.
    I think the first one is the best
     
  6. DieHollander_

    DieHollander_ Active Member

    Joined:
    Mar 25, 2018
    Messages:
    188
    Likes Received:
    12
    All three aren't working correctly lol
     
  7. CharcoalToast

    CharcoalToast Member

    Joined:
    Mar 10, 2018
    Messages:
    21
    Likes Received:
    4
    Look at my tip for the first one and then in should work.

    (Bekijk mijn tip voor de eerste en dan zou het moeten werken. Verander na 15 seconds naar false, je zet het nu naar true terwijl het al true is)
     
  8. DieHollander_

    DieHollander_ Active Member

    Joined:
    Mar 25, 2018
    Messages:
    188
    Likes Received:
    12
    Ik heb het niet getest. Alleen doorgelezen.
    --- Double Post Merged, Apr 10, 2018, Original Post Date: Apr 10, 2018 ---
    Dat wait 15 seconds is bagger. Als ik je 1 seconden voordat die 15 seconden om zijn hit, heb je al na 1 seconden uit combat
    --- Double Post Merged, Apr 10, 2018 ---
    En bij de andere 2 sla je variables op als {_time}, alles met een _ zijn tijdelijke variables. Die werken alleen in het zelfde event etc
     
  9. CharcoalToast

    CharcoalToast Member

    Joined:
    Mar 10, 2018
    Messages:
    21
    Likes Received:
    4
    Je kan dat tijdelijke ook veranderen door het te binden met de speler. Bv %player%. Dat levert een hoop meer variables op, maar dat zou normaal geen problemen mogen geven. Om toch grote hoeveelheden te voorkomen kun je ze best na de cooldown verwijderen
     
Thread Status:
Not open for further replies.

Share This Page

Loading...