This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
function dirface(){
if(fnl <= 45 && fnl > 0 || fnl <= 360 && fnl > 315) {
clientMessage("NORTH");
} else if(fnl <= 135 && fnl > 45) {
clientMessage("EAST");
} else if(fnl <= 225 && fnl > 135) {
clientMessage("SOUTH");
} else if(fnl <=315 && fnl > 225){
clientMessage("WEST");
}
function formula() {
fs = getYaw();
if(getYaw() < -360) {
sa = getYaw()/-360;
sb = Math.floor(sa)+1;
sc = sb*360;
fnl = getYaw()+sc;
dirface()
} else if(getYaw() < 0 && getYaw() >= -360) {
fnl = getYaw()+360;
} else if(getYaw() < 360 && getYaw() > 0) {
fnl = getYaw();
} else if(getYaw() > 360) {
sa = getYaw()/360;
sb = Math.floor(sa);
fnl = getYaw()-sc;
Im not a pro modder by any means, but this seems to work for me, let me know if it helps you.
You write getYaw(), I thought it is Entity.getYaw(getPlayerEnt())?
They both would work in this script, getYaw(ent) is the short version of Entity.getYaw(ent), and if no entity is specified the player become the entity
Okay, i didn't knew.
function dirface(){
if(fnl <= 45 && fnl > 0 || fnl <= 360 && fnl > 315) {
clientMessage("NORTH");
} else if(fnl <= 135 && fnl > 45) {
clientMessage("EAST");
} else if(fnl <= 225 && fnl > 135) {
clientMessage("SOUTH");
} else if(fnl <=315 && fnl > 225){
clientMessage("WEST");
}
}
function formula() {
fs = getYaw();
if(getYaw() < -360) {
sa = getYaw()/-360;
sb = Math.floor(sa)+1;
sc = sb*360;
fnl = getYaw()+sc;
dirface()
} else if(getYaw() < 0 && getYaw() >= -360) {
fnl = getYaw()+360;
dirface()
} else if(getYaw() < 360 && getYaw() > 0) {
fnl = getYaw();
dirface()
} else if(getYaw() > 360) {
sa = getYaw()/360;
sb = Math.floor(sa);
sc = sb*360;
fnl = getYaw()-sc;
dirface()
}
}
Im not a pro modder by any means, but this seems to work for me, let me know if it helps you.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou write getYaw(), I thought it is Entity.getYaw(getPlayerEnt())?
They both would work in this script, getYaw(ent) is the short version of Entity.getYaw(ent), and if no entity is specified the player become the entity
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumOkay, i didn't knew.