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

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Proting

Member
Feb 11, 2017
10
0
0
21
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_language.skript:
on damage of player:
    set {combattag.%attacker%} to true
    send "&cNow you have combattag."
    wait 15 seconds
    set {combattag.%attacker%} to true
    send "&aNow you have no combattag."
    
on command:
    {combattag.%player%} is true
    cancel event
    send "&cYou have combattag."
    
on quit:
    {combattag.%player%} is true
    kill player
    set {combattag.%player} to false
    
on join:
    set {combattag.%player%} to false

2.
code_language.skript:
on damage of player:
    set {_time} to difference between {combattag.%player%} and now
    
on command:
    if {_time} is less than 15 seconds:
        send "&cYou have combattag."
        cancel event
        stop
    set {combattag.%player%} to now
    
on quit:
    if {_time} is less than 15 seconds:
        kill player
        stop
    set {combattag.%player%} to now
    
on join:
    delete {_time}

3.
code_language.skript:
on damage of player:
    if {combattag::%player%} is not set:
        set {combattag::%player%} to now
        stop
    set {_time} to difference between {combattag::%player%} and now
    
on command:
    if {_time} is less than 15 seconds:
        cancel event
        set {_combattag} to 15 seconds
        subtract {_time} from {_combattag}
        send "&cYou have %{_combattag}% of combattag." to player
    else:
        set {combattag.%player%} to now
        
on quit:
    if {_time} is less than 15 seconds:
        kill player
        set {_combattag} to 15 seconds
        subtract {_time} from {_combattag}
    else:
        set {combattag.%player%} to now
        
on join:
    delete {_time}
 
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.
 
in what section do I publish it and how do I put it in solved?
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.
 
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
 
Ik heb het niet getest. Alleen doorgelezen.
[doublepost=1523381782,1523381711][/doublepost]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
[doublepost=1523381866][/doublepost]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
 
Ik heb het niet getest. Alleen doorgelezen.
[doublepost=1523381782,1523381711][/doublepost]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
[doublepost=1523381866][/doublepost]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
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
 
Status
Not open for further replies.