hello, I want to make a script that makes it so that when you click on the compass, the effects are given to the NEAREST player ten blocks from my location, the basis of the script is done, but I do not know how to make it so that it finds these players to issue an effect, and make a refusal if they are not within a radius of 10 blocks, I tried loop the nearest player in radius 10 around the player but gives an error. Here is my script:
on right mouse click with recovery compass:
if name of the player's tool is "&6♤ &cУправление сознанием &6♤":
loop all players in radius 10 around the player
make console execute command "/effect give %player% mining_fatigue 3 15"
make console execute command "/effect give %player% jump_boost 3 128 true"
make console execute command "/effect give %player% slowness 3 15"
make console execute command "/atom %player%"
wait 3 seconds
make console execute command "/atomstop %player%"
#loop the nearest player in radius 10 around the player not worked, help!
1 messages · Page 1 of 1 (latest)
I'm sorry, you wrote to highlight all the players, I asked the nearest one, could you change the script?
I check, there is a player next to me, there is no distance more than 10 blocks, but the effects are given only to me, but I am the performer of the script
excuse me, I might not understand you, could you fix this script?
on right mouse click with recovery compass:
if name of the player's tool is "&6♤ &cУправление сознанием &6♤":
set {} to 10
set {p} to player
loop all players in radius 10 around player:
if distance between loop-value and player is less than {}:
set {} to distance between loop-value and player
set {_p} to loop-value
make console execute command "/effect give %player% mining_fatigue 3 15"
make console execute command "/effect give %player% jump_boost 3 128 true"
make console execute command "/effect give %player% slowness 3 15"
make console execute command "/atom %player%"
wait 3 seconds
make console execute command "/atomstop %player%"
the effects are still happening on me
on right mouse click with recovery compass:
if name of the player's tool is "&6♤ &cУправление сознанием &6♤":
set {} to 10
set {p} to player
loop all players in radius 10 around player where [input is not player]:
if distance between loop-value and player is less than {}:
set {} to distance between loop-value and player
set {_p} to loop-value
make console execute command "/effect give %player% mining_fatigue 3 15"
make console execute command "/effect give %player% jump_boost 3 128 true"
make console execute command "/effect give %player% slowness 3 15"
make console execute command "/atom %player%"
wait 3 seconds
make console execute command "/atomstop %player%"
Instead of %player% you need to do %loop-value%
loop-value represents the nearest player
In the command he is doing %player%
Oh
So I’m wrong 👌
no
it works thanks bro!
lol