Hi, I'm new to skript and needed help finding the loop to detect all players around me other than me.
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!
You can always check out our Wiki for downloads and any other information about Skript!
Hi, I'm new to skript and needed help finding the loop to detect all players around me other than me.
command: /loop
trigger:
loop all players:
if loop-player is player:
stop
if loop-player is not player:
stuff
Around you? You mean in a radius? if yes, useHi, I'm new to skript and needed help finding the loop to detect all players around me other than me.
loop all players in radius <radiusHere> of player where [input is not player]:
loop all players where [input is not player]:
Thank you helped me a lot, I am making a code but I still get errors, could you help me see what is wrong?Around you? You mean in a radius? if yes, use
and if you don't want the radius, justCode:loop all players in radius <radiusHere> of player where [input is not player]:
Code:loop all players where [input is not player]:
command /robar:
trigger:
loop all players in radius 5 of player where [input is not player]:
if player is in the region "mina":
if loop-player is in the region "mina":
if loop-player = 1
send "&cEntraste en el &7Modo Ladrón&c. &cSelecciona que quieres hacer a tu víctima, pero &c<EN CUIDADO &c&lLA POLICIA FUE ALERTADA." to player
else:
send "&cNo hay nadie o hay mucha gente, busca a alguien que esté solo para robarle."
what is if loop-player = 1 supposed to beThank you helped me a lot, I am making a code but I still get errors, could you help me see what is wrong?
[doublepost=1636719429,1636719041][/doublepost]Basically, what I want to do is detect if in a specific region 5 blocks away from the player executing the command there is only one player other than the one executing it, if the player is in the region "mina" and there is only one player near him, is run the codeCode:command /robar: trigger: loop all players in radius 5 of player where [input is not player]: if player is in the region "mina": if loop-player is in the region "mina": if loop-player = 1 send "&cEntraste en el &7Modo Ladrón&c. &cSelecciona que quieres hacer a tu víctima, pero &c<EN CUIDADO &c&lLA POLICIA FUE ALERTADA." to player else: send "&cNo hay nadie o hay mucha gente, busca a alguien que esté solo para robarle."
[doublepost=1636720263][/doublepost]I forgot to say that the imput is a player, nothing but him is the one that executes it, I want the loop players to detect everyone except him (sorry my bad english btw)
sorry, I just wanted to explain what I wanted to do, the "loop-player = 1" would have the function of only detecting ONE player around 5 blocks, also, as I am very new to script, I get a lot of "tab" errors and from "spaces" I don't know how many tabs or how many spaces I should use in that codewhat is if loop-player = 1 supposed to be
sorry, I just wanted to explain what I wanted to do, the "loop-player = 1" would have the function of only detecting ONE player around 5 blocks, also, as I am very new to script, I get a lot of "tab" errors and from "spaces" I don't know how many tabs or how many spaces I should use in that code
command /robar:
trigger:
if "%region at player%" contains "mina":
loop all players in radius 5 of player where [input is not player]:
add 1 to {_} if "%region at loop-player%" contains "mina":
if {_} < 1:
send "&cEntraste en el &7Modo Ladrón&c. &cSelecciona que quieres hacer a tu víctima, pero &c<EN CUIDADO &c&lLA POLICIA FUE ALERTADA."
else:
send "&cNo hay nadie o hay mucha gente, busca a alguien que esté solo para robarle."
I keep getting an error:something like thatCode:command /robar: trigger: if "%region at player%" contains "mina": loop all players in radius 5 of player where [input is not player]: add 1 to {_} if "%region at loop-player%" contains "mina": if {_} < 1: send "&cEntraste en el &7Modo Ladrón&c. &cSelecciona que quieres hacer a tu víctima, pero &c<EN CUIDADO &c&lLA POLICIA FUE ALERTADA." else: send "&cNo hay nadie o hay mucha gente, busca a alguien que esté solo para robarle."
did you change the line? because that's not how mine looks, send a ssI keep getting an error:
"can't understand this condition: 'add 1 to {_} if region% region at loop-player% contains" mine "
the quotes seem to be changed in game, they seem to be fancy quotes, did you change them or is that just how it looks in game? also what your skript-version
do not change anything, in fact I copied and pasted it, I use an older version of skriptthe quotes seem to be changed in game, they seem to be fancy quotes, did you change them or is that just how it looks in game? also what your skript-version
command /robar:
trigger:
if player is in the region "mina":
loop all players in radius 5 of player where [input is not player]:
set {victima} to loop-player
if loop-player is in the region "mina":
set {victima} to 1
if {victima} = 1:
send "&cEntraste en el &7Modo Ladrón&c. &cSelecciona que quieres hacer a tu víctima, pero &c<EN CUIDADO &c&lLA POLICIA FUE ALERTADA."
else:
send "&cNo hay nadie o hay mucha gente, busca a alguien que esté solo para robarle."
why do you have 2 of the most outdated addons installed, and why are you setting the variable to loop-player then to 1do not change anything, in fact I copied and pasted it, I use an older version of skript![]()
[doublepost=1636734504,1636734142][/doublepost]my server recommends me to use this version![]()
[doublepost=1636734593][/doublepost]well, install the latest version and the error persists
[doublepost=1636735604][/doublepost]I'm back, doing some things I was able to fix the code but now it gives me space and tab errors, I guess it's a syntax error (I repeat, I'm new) can you help me?
Code:command /robar: trigger: if player is in the region "mina": loop all players in radius 5 of player where [input is not player]: set {victima} to loop-player if loop-player is in the region "mina": set {victima} to 1 if {victima} = 1: send "&cEntraste en el &7Modo Ladrón&c. &cSelecciona que quieres hacer a tu víctima, pero &c<EN CUIDADO &c&lLA POLICIA FUE ALERTADA." else: send "&cNo hay nadie o hay mucha gente, busca a alguien que esté solo para robarle."
I don't use any of those addons, I forgot to delete them, and I put "set loop-player = 1", since according to my knowledge in scoreboards they will continue adding numbers to loop player and there is nothing to stop it in That code, I wanted to make it only detect 1 player around 5 blocks, not how many can add loop-playerwhy do you have 2 of the most outdated addons installed, and why are you setting the variable to loop-player then to 1
so what you want is to only get 1 player in radius 5 of the player?I don't use any of those addons, I forgot to delete them, and I put "set loop-player = 1", since according to my knowledge in scoreboards they will continue adding numbers to loop player and there is nothing to stop it in That code, I wanted to make it only detect 1 player around 5 blocks, not how many can add loop-player
first element out of all players in radius 5 of player where [input != player]
you can ask here, or better yet, just join a discord server such as skunity where you can get help very quicklythanks, solved, but I have more doubts about skript, do I do it in this same thread or create another?
isnt that something you have to do?thanks i will join discord, you can mark this thread as solved![]()