Give this weapon to every player:
if(playerenters){toweapons -dragplayer;}
if (actionprojectile || actionprojectile2) {
if (strequals(#p(2),clickDrag) && strequals(#p(3),#a)) {
freezeplayer 0.3;
setani drag,;
playerx = strtofloat(#p(4));
playery = strtofloat(#p(5));
}
}
Give this weapon to staff:
if (playertouchsme){
toweapons Staff/Drag;
hidelocal;
}
if (weaponfired) {
if (!this.on) {
set this.on; setplayerprop #c,On;
}
else {
unset this.on; setplayerprop #c,Off;
}
this.target = -1;
timeout = 0.05;
}
if (timeout) {
if (!this.on)
return;
timeout = 0.05;
getTarget();
moveTarget();
}
function getTarget() {
if (leftmousebutton) {
if (!this.lmb) {
set this.lmb;
for (i=0;i<playerscount;i++) {
if (abs(players[i].x+1.5-mousex) < 1 && abs(players[i].y+1.5-mousey) < 1.5) {
this.target = i;
this.dx = players[i].x;
this.dy = players[i].y;
this.omousex = mousex;
this.omousey = mousey;
break;
}
}
}
}
else {
this.target = -1;
unset this.lmb;
}
}
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;
}
here is the gani for it
drag.gani