Skript: No looping of entities from a location

Created on 4 Jan 2017  路  7Comments  路  Source: SkriptLang/Skript

Example Script with Issue:
https://hastebin.com/ekayaxaqis.coffeescript

  • No console errors
  • No loading errors
  • No entities being broadcasted

Using Latest 22g
http://i.imgur.com/RazCaSK.png (script addons)

Tested in versions 1.11.2 and 1.10.2

Example Script with Issue without function usage:
https://hastebin.com/usutoxigim.sql

bug

Most helpful comment

That code does not work on my server either. I have many scripts with similar functions that all work just fine so after examining all my working ones i figured out the difference between my code and yours. It always works the way you have it if its a player or loop-entity but if its a variable it needs to be modified slightly to work.

If you change from:

loop entities in radius 10 around {_loc}:

to:

loop entities in radius 10 around location of {_loc}:

it will work just fine. It seems that skript is not looking at the variable as a location until you specify to use its location. Not sure if this is intended or if it is indeed a bug that variables are not being checked for location data by default without having to specify to use its location information..

All 7 comments

test is > loop entities in radius 10 around {_loc}:

That code does not work on my server either. I have many scripts with similar functions that all work just fine so after examining all my working ones i figured out the difference between my code and yours. It always works the way you have it if its a player or loop-entity but if its a variable it needs to be modified slightly to work.

If you change from:

loop entities in radius 10 around {_loc}:

to:

loop entities in radius 10 around location of {_loc}:

it will work just fine. It seems that skript is not looking at the variable as a location until you specify to use its location. Not sure if this is intended or if it is indeed a bug that variables are not being checked for location data by default without having to specify to use its location information..

hmm, I feel like it should return some feedback in this situation either way

I've always had this issue as well. You can also do loop entities in radius 10 around {_loc}'s location. But yeah, there's definitely an issue with Skript not viewing the variable as a location in this context, I've had to use that workaround for a long time.

function loopentity(player:player,loc:location,world:world,int:integer):
    send "start." to {_player}
    loop all living entities in world {_world}:
        distance between location of loop-entity and {_loc} <= {_int}
        send "i am %loop-entity%." to {_player}
    send "stop." to {_player}
command loop-entity <integer = 10>:
    trigger:
        loopentity(player,location,world,arg-1)

@FUZIK that would be so laggy, just use the workaround that JeepMash said.

or use skellets looping entities, kappa

Was this page helpful?
0 / 5 - 0 ratings