Solved Apply potion effect to near entities

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

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

Spouth

Member
Jun 21, 2020
3
0
1
23
Code:
on rightclick:
   loop all entities in world of player:
       if the distance between the player and entity is smaller than 5:
           if the entity is not player:
               apply slowness 5 to the entity for 10 seconds
Ok, so there's a few weird problems. When I right click, only one entity gets slowness. The entity that gets slowness is the one, I am looking at. If I am not looking at an entity, nothing happens(I am holding an item when I do this). Also slowness 5 is given to it for an infinite amount time.
[doublepost=1592811788,1592808366][/doublepost]
Code:
on rightclick:
   loop all entities in world of player:
       if the distance between the player and entity is smaller than 5:
           if the entity is not player:
               apply slowness 5 to the entity for 10 seconds
Ok, so there's a few weird problems. When I right click, only one entity gets slowness. The entity that gets slowness is the one, I am looking at. If I am not looking at an entity, nothing happens(I am holding an item when I do this). Also slowness 5 is given to it for an infinite amount time.
Ok, so i replaced entity with loop-entity and everything started working.
 
Status
Not open for further replies.