Amount of entities in certain range

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

LeeifMR

Member
Oct 2, 2024
27
1
3
Hey, I am trying to make a skript where if the players is wearing armor that contains the lore "&7Fear Aura I" it will increase your damage by 10% for each entity in range of the player. But the one problem is I don't know how find out how many entities are in range of the player, everything else is working, but line 6 has an error
Code:
on damage:
    attacker is a player
    victim is a player
    if lore of attacker's helmet contains "&7Fear Aura I":
        loop all entities in radius 5 of attacker:
            for each entity in radius 5 of attacker:
                increase damage by 10%
 
Code:
on damage:
  if attacker is a player:
    victim is a player
    if lore of attacker's helmet contains "&7Fear Aura I":
      loop all entities in radius 5 of attacker:
      add 1 to {_entity}
    set {_d} to {_entity} * 10
    increase damage by {_d}%
 
Code:
on damage:
  if attacker is a player:
    victim is a player
    if lore of attacker's helmet contains "&7Fear Aura I":
      loop all entities in radius 5 of attacker:
      add 1 to {_entity}
    set {_d} to {_entity} * 10
    increase damage by {_d}%
'{_d} can't be added to the damage because the former is not a number'
 
Nevermind, I got it
Code:
on damage:
  if attacker is a player:
    victim is a player
    if lore of attacker's helmet contains "&7Fear Aura I":
      loop all entities in radius 5 of attacker:
        add 1 to {_entity}
        set {_d} to {_entity} * 50%
        increase damage by {_d}

Thanks!