Here’s the supposed fix for the staff hud. I rescripted almost everything saving a few fragments.
The only real difference in performance is I added a conflict feature so it’ll not allow use of conflicting tools at the same time.
This being clickjail and clickdrag.
The main weapon, this will only be provided to staff:
// NPC made by tricxta
if (playerenters){
if (!isweapon)toweapons -staffHud;
setstring this.img,riley_alexadmintoolgui-edit.gif;//image used
setarray this.on,6;//array of options toggled
this.conflict = {3,5};//options that conflict with each other
if (strequals(#s(client.staffguild), ))
setstring client.staffguild,Admin;
//Define this. Put the name of the guild you want set when you set your staff tag. If the guild is named "Admin" put Admin.
this.bootsSpeed = {0,10};//min,max
timeout = 0.05;
}
if (mousedown && isweapon){
if (mousescreenx in |this.placeC[0]+11,this.placeC[0]+249| && mousescreeny in |this.placeC[1]+19,this.placeC[1]+57|){
for (this.i = 0; this.i < 6; this.i++){
if (this.i == 1 && this.on[0] == 1){//boot speed
for (this.b = 0; this.b < 2; this.b++){
this.checkC = {this.placeC[0]+52+this.b*17,this.placeC[1]+39};
if (mousescreenx in |this.checkC[0],this.checkC[0]+16| && mousescreeny in |this.checkC[1],this.checkC[1]+16|)
this.bootSpeed = max(this.bootsSpeed[0],min(this.bootsSpeed[1],this.bootSpeed-vecy(this.b*2)));
}
}
else {
this.checkX = this.placeC[0]+11+this.i*41-(this.i > 1)*5;
if (mousescreenx in |this.checkX,this.checkX+38|){
this.on[this.i] = (this.on[this.i]+1)%2;
if (this.i in this.conflict && this.on[this.i] == 1){//turn off all other tools that conflict
for (this.t = 0; this.t < arraylen(this.conflict);this.t++){
if (this.i == this.conflict[this.t])continue;
this.on[this.conflict[this.t]] = 0;
}
}
if (this.i == 4)admin();
}
}
}
timeout = 0.05;
}
else{
if (this.on[3] == 1)//jailer
getTarget();
setshootparams clickJail,#a(this.target);
shoot -10,-10,0.05,0.05,0.05,0.05,,,,,;
}
}
if (timeout && isweapon){
this.placeC = {0,screenheight-89};
showimg 300,#s(this.img),this.placeC[0],this.placeC[1];
changeimgpart 300,0,89,260,77;
changeimgvis 300,4;
//dragging
if (leftmousebutton && this.on[5] == 1){
if (!lmb){
getTarget();
set lmb;
}
moveTarget();
}
else {
unset lmb;
this.target = -1;
}
for (this.i = 0; this.i < 6; this.i++){
if (this.i == 1){//boot options
if (this.on[0] == 0){hideimgs 301,303; hideimg 305;}
else {
showtext 305,this.placeC[0]+69,this.placeC[1]+29,arial,cb,#v(this.bootSpeed);
changeimgzoom 305,0.5;
changeimgvis 305,5;
for (this.b = 0; this.b < 2; this.b++){
if (this.bootSpeed == this.bootsSpeed[1-this.b]){
showimg 301+this.b,#s(this.img),this.placeC[0]+52+this.b*17,this.placeC[1]+39;
changeimgpart 301+this.b,52+this.b*17,65,17,20;
changeimgvis 301+this.b,5;
}
else hideimg 301+this.b;
}
}
}
else if (this.on[this.i] == 0)
hideimg 304+this.i;
else {
this.placeX = this.placeC[0]+11+this.i*41-(this.i > 1)*5;
showimg 304+this.i,#s(this.img),this.placeX,this.placeC[1]+19;
changeimgpart 304+this.i,11+this.i*41-(this.i>1)*5,46,39,40;
changeimgvis 304+this.i,5;
if (this.i == 0)boots();
else if (this.i == 2)stealth();
}
}
timeout = 0.05;
}
function boots(){
for (this.k = 0; this.k < 4; this.k++){
if (keydown(this.k)){
playerx += vecx(this.k)*this.bootSpeed;
playery += vecy(this.k)*this.bootSpeed;
}
}
}
function stealth(){
hideplayer .05;
setani stealth,;
putleaps 1,playerx+.5,playery+.5;
}
function admin(){
if (this.on[4] == 1){
playerap = 100;
triggeraction 0,0,gr.setguild,#s(client.staffguild),#a;
}
else {
playerap = 60;
setplayerprop #c,setnick #e(0,indexof(#s(client.staffguild),#n),#n);
sleep 0.1;
setplayerprop #c, ;
}
}
function getTarget(){
this.target = -1;
for (this.j=0;this.j<playerscount;this.j++) {
if (abs(players[this.j].x+3-mousex) in |0,3| && abs(players[this.j].y+3-mousey) in |0,3|) {
this.target = this.j;
this.j = playerscount;
}
}
}
function moveTarget() {
if (this.target < 0) return;
this.dx += mousex-this.omousex;
this.dy += mousey-this.omousey;
setshootparams clickDrag,#a(this.target),#v(this.dx),#v(this.dy);
shoot -10,-10,0.05,0.05,0.05,0.05,,,,,;
this.omousex = mousex;
this.omousey = mousey;
}
And the supporting weapon which will allow you to drag players and jail them. You give this to everyone.
if (playerenters){
if (!isweapon)toweapons -toolSupport;
setstring this.jailLevel,jail.nw,30,30;
}
if (actionprojectile || actionprojectile2) {
if (strequals(#p(2),clickDrag) && strequals(#p(3),#a)) {
freezeplayer 0.3;
setani idle,;
playerx = strtofloat(#p(4));
playery = strtofloat(#p(5));
}
else if (strequals(#p(2),clickJail) && strequals(#p(3),#a)){
setlevel2 #I(this.jailLevel,0),strtofloat(#I(this.jailLevel,1)),strtofloat(#I(this.jailLevel,2));
}
}
Let the pw abuse commence!