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.

Capture Point Capping

Discussion in 'Skript' started by Jerooski, Aug 11, 2020.

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

    Jerooski Member

    Joined:
    Apr 19, 2020
    Messages:
    16
    Likes Received:
    0
    Im having trouble with a KOTH, so as long as a player is in the control point, it will keep adding points until it reaches 500, I have no trouble when players are no longer capping the point, but when they go back into the point it adds all the points that the player would have gained if he was in the point but they get added only if he joins the capture point again.

    Code (Text):
    1. on walk on white wool or lime wool or orange wool:
    2.     if {koth} is true:
    3.         if distance between player and {KOTH::Location} is less than 4:
    4.             if {capping::*} contains player:
    5.                 stop
    6.             else:
    7.                 add player to {capping::*}
    8.                 if {limeteam::*} contains player:
    9.                     while {limescore} is not 500:
    10.                         if {capping::*} contains player:
    11.                             set line 6 of all players' scoreboards to "&e%{limescore}%"
    12.                             if {limescore} is less than or equal to 100:
    13.                                 broadcast "&d&lKOTH &7» &a&lLIME TEAM &7is at 100!"
    14.                             if {limescore} is between 101 and 200:
    15.                                 broadcast "&d&lKOTH &7» &a&lLIME TEAM &7is at 200!"
    16.                             if {limescore} is between 201 and 300:
    17.                                 broadcast "&d&lKOTH &7» &a&lLIME TEAM &7is at 300!"
    18.                             if {limescore} is between 301 and 400:
    19.                                 broadcast "&d&lKOTH &7» &a&lLIME TEAM &7is about to win!"
    20.                         wait 3 seconds
    21.                         add 100 to {limescore}
    22.                     pop burst colored lime fading to green at {KOTH::Location}
    23.                     send title "&a&lGAME OVER" with subtitle "&a&lLime Wins!" to all players for 3 seconds
    24.  
    25. on walk on grass:
    26.     if {koth} is true:
    27.         {capping::*} contains player
    28.         message "&eYou are no longer capturing!" to player
    29.         remove player from {capping::*}
     
  2. Hackusater

    Hackusater Active Member

    Joined:
    Aug 5, 2017
    Messages:
    74
    Likes Received:
    2
    You can either add this to the while loop
    Code (Text):
    1. if distance between player and {KOTH::Location} is less than 4:
    or do this:
    Code (Text):
    1.         if distance between player and {KOTH::Location} is less than 4:
    2.             if {capping::*} contains player:
    3.                 stop
    4.         else:
    5.             remove player from {capping::*}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...