Hello everybody, I need help with location radius script. Here is my location radius code: Code: int x = -16; int y = 72; int z = 270; int radius = 5; double distance = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z, 2)); if (distance <= radius) System.out.println("PLAYER SPAWNED IN SAFE LOCATION"); else System.out.println("PLAYER SPAWNED IN UNSAFE LOCATION"); I don' know why but it's always false... Server says that i spawned in unsafe location but really i'm in safe location... Can you help me?
You are not calculation any distance. Where is you second point? Code: Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z, 2));
I need to increase this coordinates radius: int x = -16; int y = 72; int z = 270; Now i should stay at -16 72 270 but i want to make -16 to -11 72 to 77 and 270 to 275 +5 radius how to make it?