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

FFA points not working

Discussion in 'Skript' started by SMASHERYT, May 29, 2019.

  1. SMASHERYT

    SMASHERYT Member

    Joined:
    May 6, 2019
    Messages:
    8
    Likes Received:
    0
    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 (Text):
    1.  
    2. # variables
    3. variables:
    4.     {ffakill::%player%} = 0
    5.     {ffadeath::%player%} = 0
    6.     {ffaspawn} = "none"
    7.     {combat.tag::%player%} = "false"
    8. on join:
    9.     set {ffakillstreak::%player%} to 0
    10. # the commands
    11. command /ffa [<text>]:
    12.     trigger:
    13.         if arg-1 is not set:
    14.             if player has permission "ffa.default":
    15.                 world is "FFA"
    16.                 send "&b&m----------&r &a&lFFA&r &b&m------------"
    17.                 send "&a/ffa stats &eto show ffa stats"
    18.                 send "&a/ffa shop &eto open ffa shop"
    19.                 send "&a/ffa spawn &eto teleports to ffa spawn"
    20.                 send "&b&m--------------------------"
    21.         if arg-1 is "help":
    22.             if player has permission "ffa.default":
    23.                 world is "FFA"
    24.                 send "&b&m----------&r &a&lFFA&r &b&m------------"
    25.                 send "&a/ffa stats &eto show ffa stats"
    26.                 send "&a/ffa shop &eto open ffa shop"
    27.                 send "&a/ffa spawn &eto teleports to ffa spawn"
    28.                 send "&b&m--------------------------"
    29.         if arg-1 is "deaths":
    30.             send "&aYour deaths is &c%{ffadeath::%player%}%"
    31.         if arg-1 is "shop":
    32.             if player has permission "ffa.default":
    33.                 world is "FFA"
    34.                 open chest with 3 rows named "&c&lFFA&r &eshop" to player
    35.                 wait 3 ticks
    36.                 format slot 13 of player with iron sword named "&6&lWarrior kit" with lore "&aPurshase warrior kit" to close
    37.         if arg-1 is "setshop":
    38.             if player has permission "ffa.admin":
    39.                 make player execute "/npc create &c&lFFA&r &eshop"
    40.                 wait 1 tick
    41.                 make player execute "/npc skin shop"
    42.                 wait 1 tick
    43.                 make player execute "/npc cmdadd -o ffa shop"
    44.         if arg-1 is "spawn":
    45.             if player has permission "ffa.default":
    46.                 if {ffaspawn} is "none":
    47.                     world is "FFA"
    48.                     send "&cFFA spawn is not set"
    49.                 else:
    50.                     if {combat.tag::%player%} is "false":
    51.                         world is "FFA"
    52.                         clear player's inventory
    53.                         teleport player to {ffaspawn}
    54.                     else:
    55.                         world is "FFA"
    56.                         send "&cYou cant teleport while in combat tag!"
    57.         if arg-1 is "setspawn":
    58.             if player has permission "ffa.admin":
    59.                 if world is "FFA":
    60.                     set {ffaspawn} to location of player
    61.                     send "&aSuccessful spawn set."
    62.                 else:
    63.                     send "&cYou are not in FFA world."
    64.         if arg-1 is "stats":
    65.             if world is "FFA":
    66.                 close player's inventory
    67.                 open chest with 3 rows named "&c&lFFA&r &estats" to player
    68.                 wait 3 ticks
    69.                 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 ""
    70. command /spawn:
    71.     trigger:
    72.         if player has permission "ffa.default":
    73.             if {ffaspawn} is "none":
    74.                 world is "FFA"
    75.                 send "&cFFA spawn is not set"
    76.             else:
    77.                 if {combat.tag::%player%} is "false":
    78.                     world is "FFA"
    79.                     clear player's inventory
    80.                     teleport player to {ffaspawn}
    81.                 else:
    82.                     world is "FFA"
    83.                     send "&cYou cant teleport while in combat tag!"
    84. # scoreboard requires SKRayFall
    85. on world change:
    86.     world is "FFA"
    87.     clear player's inventory
    88.     loop all players:
    89.         wipe loop-player's sidebar
    90.         set name of sidebar of loop-player to "&6&lFFA"
    91.         set score "&f" in sidebar of loop-player to 9
    92.         set score "&eWelcome: &a%loop-player%" in sidebar of loop-player to 8
    93.         set score "&f" in sidebar of loop-player to 7
    94.         set score "&eKills: &a%{ffakill::%loop-player%}%" in sidebar of loop-player to 6
    95.         set score "&eKills streak: &a%{ffakillstreak::%loop-player%}%" in sidebar of loop-player to 5
    96.         set score "&eDeaths: &a%{ffadeath::%loop-player%}%" in sidebar of loop-player to 4
    97.         set score "&f" in sidebar of loop-player to 3  
    98.         set score "&f" in sidebar of loop-player to 2
    99.         set score "&esmashingmc.aternos.me" in sidebar of loop-player to 1
    100. # the clear inventory on spawn set requires SKQuery
    101. on walking on gold block:
    102.     if world is "FFA":
    103.         clear player's inventory
    104. # the kit set
    105. on any movement:
    106.     if world is "FFA":
    107.         y-coordinate of player is below 12
    108.         y-coordinate of player is above 7
    109.         set slot 0 of player to iron sword
    110.         set slot 1 of player to bow
    111.         set slot 2 of player to fishing rod
    112.         set slot 8 of player to 2 golden apple
    113.         set slot 9 of player to 16 arrow
    114.         set helmet of player to iron helmet
    115.         set chestplate of player to iron chestplate
    116.         set leggings of player to iron leggings
    117.         set boots of player to iron boots      
    118. # points set
    119. on death:
    120.     attacker is player
    121.     victim is player
    122.     add 1 to {ffadeath::%victim%}
    123.     add 1 to {ffakill::%attacker%}
    124.     add 1 to {ffakillstreak::%attacker%}
    125.     set {ffakillstreak::%victim%} to "0"
    126.     wait 1 tick
    127.     execute console command "/heal %attacker%"
    128.     wait 1 second
    129.     teleport victim to {ffaspawn}
    130.     wait 1 tick
    131.     clear victim's inventory
    132. # cancel the fall damage
    133. on damage:
    134.     damage was caused by fall
    135.     world is "FFA"
    136.     cancel event
    137. # know victim health when shooting an arrow
    138. on damage:
    139.     wait 1 tick
    140.     attacker is a player
    141.     projectile exists
    142.     projectile is arrow
    143.     wait 1 tick
    144.     victim is not dead
    145.     message "&c%victim%&e is on &c%health of victim% &eHP" to the attacker
    146. # start the tag
    147. on damage:
    148.     world is "FFA"
    149.     attacker is a player
    150.     victim is player
    151.     if {combat.tag::%attacker%} is "false":
    152.         send "&cYou entered combat. Don't log out for 10 seconds." to attacker
    153.         wait 1 tick
    154.         set {combat.tag::%attacker%} to "true"
    155.         wait 10 seconds
    156.         set {combat.tag::%attacker%} to "false"
    157.     if {combat.tag::%victim%} is "false":
    158.         send "&cYou entered combat. Don't log out for 10 seconds." to victim
    159.         wait 1 tick
    160.         set {combat.tag::%victim%} to "true"
    161.         wait 10 seconds
    162.         set {combat.tag::%victim%} to "false"
    163. # disable tp while combat tag
    164. on command "spawn" or "warp" or "tpa" or "mine" or "hub" or "ffa spawn" or "home":
    165.     world is "FFA"
    166.     {combat.tag::%player%} is "true"
    167.     message "&cTeleporting is disabled while in combat."
    168.     cancel event
    169. # remove the tag on quit
    170. On quit:
    171.     if {combat.tag::%player%} is "true":
    172.         set {combat.tag::%player%} to "true"
    173. # warn that tag removed on join
    174. On join:
    175.     wait 2 seconds
    176.     set {combat.tag::%player%} to "false"
    177. # to bypass enabling/disabling it (just saw it in PvPTemple xd)
    178. command /combatlog <text>:
    179.     aliases: /cbl, /cblog, /clog
    180.     usage: &c/combatlog [on/off]
    181.     permission: combatlog.bypass
    182.     permission message: &cYou don't have permission to perform that command.
    183.     trigger:
    184.         send "&aYou have turned combatlogging to %arg 1%"
    185.         if arg 1 is "on":
    186.             if {combat.tag::%player%} is "true":
    187.                 set {combat.tag::%player%} to "false"
    188.         if arg 1 is "off":
    189.             stop trigger
    190.  
    --- Double Post Merged, May 30, 2019, Original Post Date: May 29, 2019 ---
    is there is response?
     
  2. IDuckz_

    IDuckz_ Active Member

    Joined:
    Jul 25, 2019
    Messages:
    28
    Likes Received:
    0
    Not sure if you can do that in a GUI, I am not a skript god.
     
  3. Runakai1

    Runakai1 Well-Known Member

    Joined:
    Apr 27, 2018
    Messages:
    386
    Likes Received:
    20
    you simply forgot to check if the attacker/victim is A player, not is player
     
Loading...