IF condition in loop

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

    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.

laizhen828

Member
Sep 24, 2020
1
0
1
Hi, Im trying to create a system that shares exp between party members. Here is the code below:

on death:
loop all players in radius 30 around the attacker:
if loop-player is not attacker:
if {%attacker%.party} is the same as {%loop-player%.party}:
send "shared" to loop-player

I am sure that both the variables used in the code above returns the same value. But the IF condition doesnt work for some reason.. Can anyone help?
 
Indentation errors mate, thats your problem, simple fix. no worrys :emoji_smiley:
Code:
on death:
  loop all players in radius 30 around the attacker:
    if loop-player is not attacker:
      if {%attacker%.party} is the same as {%loop-player%.party}:
        send "shared" to loop-player

There ja go
 
Status
Not open for further replies.