Help with CTF skript

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

Vane

Member
May 27, 2019
11
0
1
Hello there, I have ctf skript made, works fine however since I disabled event damage and when I fall into void or someone else falls into void it doesn't kill us.
[doublepost=1558997129,1558997063][/doublepost]
Code:
on damage:
    cancel event
    if {CTF::PLAYERS::%attacker%::IN-GAME} is true:
        if {CTF::PLAYERS::%victim%::IN-GAME} is true:
            if {CTF::ARENAS::%{CTF::PLAYERS::%attacker%::ARENA}%::STATE} = 1:
                if {CTF::PLAYERS::%attacker%::TEAM} != {CTF::PLAYERS::%victim%::TEAM}:
                    uncancel event
 
Thats because of
code_language.skript:
if {CTF::PLAYERS::%attacker%::IN-GAME} is true:
There is no attacker in a damage event caused by the void, therefor the event is staying cancelled
 
You could try something like:
code_language.skript:
on damage:
    if damage cause is not void:
        cancel event
        #your other code here
 
Like this?
Code:
on damage:
    if damage cause is not void:
    cancel event
    if {CTF::PLAYERS::%attacker%::IN-GAME} is true:
        if {CTF::PLAYERS::%victim%::IN-GAME} is true:
            if {CTF::ARENAS::%{CTF::PLAYERS::%attacker%::ARENA}%::STATE} = 1:
                if {CTF::PLAYERS::%attacker%::TEAM} != {CTF::PLAYERS::%victim%::TEAM}:
                    uncancel event
[doublepost=1558998496,1558998378][/doublepost]Still not killing me on void and no errors when reloading skript
 
Notice how my code is indented and yours is not?
Screen Shot 2019-05-27 at 4.08.59 PM.png
 
Might of found a solution
Code:
on damage:
    if damage cause is not void:
        cancel event
            if {CTF::PLAYERS::%attacker%::IN-GAME} is true:
                if {CTF::PLAYERS::%victim%::IN-GAME} is true:
                    if {CTF::ARENAS::%{CTF::PLAYERS::%attacker%::ARENA}%::STATE} = 1:
                        if {CTF::PLAYERS::%attacker%::TEAM} != {CTF::PLAYERS::%victim%::TEAM}:
                            uncancel event
actually that didn't work
 
code_language.skript:
[INDENT][LIST=1]
[*]on damage:
[*]    if damage cause is not void:
[*]        cancel event
[*]            if {CTF::PLAYERS::%attacker%::IN-GAME} is true:
[*]                if {CTF::PLAYERS::%victim%::IN-GAME} is true:
[*]                    if {CTF::ARENAS::%{CTF::PLAYERS::%attacker%::ARENA}%::STATE} = 1:
[*]                        if {CTF::PLAYERS::%attacker%::TEAM} != {CTF::PLAYERS::%victim%::TEAM}:
[*]                            uncancel event
[/LIST][/INDENT]
 
Status
Not open for further replies.