FFA points not working

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

SMASHERYT

New Member
May 6, 2019
8
0
0
33
hello i was creating FFA when i wanted to test it the scoreboard is not set to the world
and in "/ffa stats" the points not changing when killing/dying
Addons:
Skellet
skRayFall
WildSkript
SKQuery
here is the code no errors while reload or in console
Code:
# variables
variables:
    {ffakill::%player%} = 0
    {ffadeath::%player%} = 0
    {ffaspawn} = "none"
    {combat.tag::%player%} = "false"
on join:
    set {ffakillstreak::%player%} to 0
# the commands
command /ffa [<text>]:
    trigger:
        if arg-1 is not set:
            if player has permission "ffa.default":
                world is "FFA"
                send "&b&m----------&r &a&lFFA&r &b&m------------"
                send "&a/ffa stats &eto show ffa stats"
                send "&a/ffa shop &eto open ffa shop"
                send "&a/ffa spawn &eto teleports to ffa spawn"
                send "&b&m--------------------------"
        if arg-1 is "help":
            if player has permission "ffa.default":
                world is "FFA"
                send "&b&m----------&r &a&lFFA&r &b&m------------"
                send "&a/ffa stats &eto show ffa stats"
                send "&a/ffa shop &eto open ffa shop"
                send "&a/ffa spawn &eto teleports to ffa spawn"
                send "&b&m--------------------------"
        if arg-1 is "deaths":
            send "&aYour deaths is &c%{ffadeath::%player%}%"
        if arg-1 is "shop":
            if player has permission "ffa.default":
                world is "FFA"
                open chest with 3 rows named "&c&lFFA&r &eshop" to player
                wait 3 ticks
                format slot 13 of player with iron sword named "&6&lWarrior kit" with lore "&aPurshase warrior kit" to close
        if arg-1 is "setshop":
            if player has permission "ffa.admin":
                make player execute "/npc create &c&lFFA&r &eshop"
                wait 1 tick
                make player execute "/npc skin shop"
                wait 1 tick
                make player execute "/npc cmdadd -o ffa shop"
        if arg-1 is "spawn":
            if player has permission "ffa.default":
                if {ffaspawn} is "none":
                    world is "FFA"
                    send "&cFFA spawn is not set"
                else:
                    if {combat.tag::%player%} is "false":
                        world is "FFA"
                        clear player's inventory
                        teleport player to {ffaspawn}
                    else:
                        world is "FFA"
                        send "&cYou cant teleport while in combat tag!"
        if arg-1 is "setspawn":
            if player has permission "ffa.admin":
                if world is "FFA":
                    set {ffaspawn} to location of player
                    send "&aSuccessful spawn set."
                else:
                    send "&cYou are not in FFA world."
        if arg-1 is "stats":
            if world is "FFA":
                close player's inventory
                open chest with 3 rows named "&c&lFFA&r &estats" to player
                wait 3 ticks
                format slot 13 of player with player's skull named "&6Stats" with lore "&7&m----------------------------------- || ||&cKills: &a%{ffakill::%player%}% ||&cDeaths: &a%{ffadeath::%player%}% ||&cKills streak: &a%{ffakillstreak::%player%}% ||&7&m-----------------------------------" to close then run ""
command /spawn:
    trigger:
        if player has permission "ffa.default":
            if {ffaspawn} is "none":
                world is "FFA"
                send "&cFFA spawn is not set"
            else:
                if {combat.tag::%player%} is "false":
                    world is "FFA"
                    clear player's inventory
                    teleport player to {ffaspawn}
                else:
                    world is "FFA"
                    send "&cYou cant teleport while in combat tag!"
# scoreboard requires SKRayFall
on world change:
    world is "FFA"
    clear player's inventory
    loop all players:
        wipe loop-player's sidebar 
        set name of sidebar of loop-player to "&6&lFFA"
        set score "&f" in sidebar of loop-player to 9
        set score "&eWelcome: &a%loop-player%" in sidebar of loop-player to 8
        set score "&f" in sidebar of loop-player to 7
        set score "&eKills: &a%{ffakill::%loop-player%}%" in sidebar of loop-player to 6
        set score "&eKills streak: &a%{ffakillstreak::%loop-player%}%" in sidebar of loop-player to 5
        set score "&eDeaths: &a%{ffadeath::%loop-player%}%" in sidebar of loop-player to 4
        set score "&f" in sidebar of loop-player to 3   
        set score "&f" in sidebar of loop-player to 2
        set score "&esmashingmc.aternos.me" in sidebar of loop-player to 1
# the clear inventory on spawn set requires SKQuery
on walking on gold block:
    if world is "FFA":
        clear player's inventory
# the kit set
on any movement:
    if world is "FFA":
        y-coordinate of player is below 12
        y-coordinate of player is above 7
        set slot 0 of player to iron sword
        set slot 1 of player to bow
        set slot 2 of player to fishing rod
        set slot 8 of player to 2 golden apple
        set slot 9 of player to 16 arrow
        set helmet of player to iron helmet
        set chestplate of player to iron chestplate
        set leggings of player to iron leggings
        set boots of player to iron boots       
# points set
on death:
    attacker is player
    victim is player
    add 1 to {ffadeath::%victim%}
    add 1 to {ffakill::%attacker%}
    add 1 to {ffakillstreak::%attacker%}
    set {ffakillstreak::%victim%} to "0"
    wait 1 tick
    execute console command "/heal %attacker%"
    wait 1 second
    teleport victim to {ffaspawn}
    wait 1 tick
    clear victim's inventory
# cancel the fall damage
on damage:
    damage was caused by fall
    world is "FFA"
    cancel event
# know victim health when shooting an arrow
on damage:
    wait 1 tick
    attacker is a player
    projectile exists
    projectile is arrow
    wait 1 tick
    victim is not dead
    message "&c%victim%&e is on &c%health of victim% &eHP" to the attacker
# start the tag
on damage:
    world is "FFA"
    attacker is a player
    victim is player
    if {combat.tag::%attacker%} is "false":
        send "&cYou entered combat. Don't log out for 10 seconds." to attacker
        wait 1 tick
        set {combat.tag::%attacker%} to "true"
        wait 10 seconds
        set {combat.tag::%attacker%} to "false"
    if {combat.tag::%victim%} is "false":
        send "&cYou entered combat. Don't log out for 10 seconds." to victim
        wait 1 tick
        set {combat.tag::%victim%} to "true"
        wait 10 seconds
        set {combat.tag::%victim%} to "false"
# disable tp while combat tag
on command "spawn" or "warp" or "tpa" or "mine" or "hub" or "ffa spawn" or "home":
    world is "FFA"
    {combat.tag::%player%} is "true"
    message "&cTeleporting is disabled while in combat."
    cancel event
# remove the tag on quit
On quit:
    if {combat.tag::%player%} is "true":
        set {combat.tag::%player%} to "true"
# warn that tag removed on join
On join:
    wait 2 seconds
    set {combat.tag::%player%} to "false"
# to bypass enabling/disabling it (just saw it in PvPTemple xd)
command /combatlog <text>:
    aliases: /cbl, /cblog, /clog
    usage: &c/combatlog [on/off]
    permission: combatlog.bypass
    permission message: &cYou don't have permission to perform that command.
    trigger:
        send "&aYou have turned combatlogging to %arg 1%"
        if arg 1 is "on":
            if {combat.tag::%player%} is "true":
                set {combat.tag::%player%} to "false"
        if arg 1 is "off":
            stop trigger
[doublepost=1559242483,1559114022][/doublepost]is there is response?
 
you simply forgot to check if the attacker/victim is A player, not is player
 
Status
Not open for further replies.