add 1 value for each loop player

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

Benno812

Member
Mar 1, 2017
13
0
1
31
I'm creating a sort of "capture the outpost" for factions but i cant do some parts:

Faction A is controlling an Outpost.
Faction B arrives at the outpost and click on the totem at the center.
The War starts and the loop starts counting all the player in a 30 radius from the totem.
SkDragon draw a circle representing the radius.
A variable defines the status of the outpost. 100 is neutral, 200 is conquered, 0 is defended.
At the beginning of the war the variable is 100 (neutral).
For each enemy player in the loop radius, 1 is added to the variable.
For each friendly player in the loop radius, 1 is removed from the variable.
 
code_language.skript:
on right click on beacon: #whatever your totem is
    loop all players in radius 7 around event-location:
        add 1 to {members}
If you have the addon Conquer, you can get a certain player's faction.
code_language.skript:
on right click on beacon: #whatever your totem is
    loop all players in radius 7 around event-location:
        if loop-player's faction is loop-player's faction:
            add 1 to {players}
        else:
            remove 1 from {players}
 
Thank you! This should work.
I have Conquer .jar in the plugins folder but it doesnt generate the Conquer Folder. I have a 1.12 server with Conquer for 1.12...
 
lol...you're right. I also need a timer for the loop..i mean the loop must repeat every second until the variable reaches 200 or 0