Author Topic: Follow code freaking out  (Read 1583 times)

why isnt this working?
its supposed to make the player follow whoever is entered. but it doesnt.
Code: [Select]
function servercmdsecretfollow(%client,%followobj)
{
 %player = %client;
 if(!isObject(%client)){return;}
for(%i=0;%i<ClientGroup.getCount();%i++){
%cl = ClientGroup.getObject(%i);
if(%cl.name$=%followobj||%cl.BL_ID$=%followobj){
%pl = %cl;
}
}
 %pos = %pl.player.position;
 %client.player.setaimLocation(getword(%pos,0) SPC getword(%pos,1) SPC getword(%pos,2)+3);
 %client.player.setmovedestination(getword(%pos,0) SPC getword(%pos,1) SPC getword(%pos,2)+1);
 %client.sfollow = schedule(500,0,"secretfollow",%client,%followobj);
}

setAimLocation and setMoveLocation only work for AIPlayers without a set controlling object. Not players which are controlled by a client.

you could also just make them AI controled then switch them back when they are done following.

You can't switch an object's class like that, and if you stop them controlling the player then the camera glitches up for the person who typed /secretfollow...

ok, is there any work around to this?

you set them to a new control object as you control their body.
then you could have the new control object orbit their body. but yea space, the camera could glitch up

If you some how get this to work, I see an Aimbot coming.

When I made a "turn player into guard" gun in rtb, all I did was make the players spawn with the aiplayer class. You could try changing the client's player object right after it is created using a package. Although after that you would probably won't the set the player's view to an orbit camera around themselves.

If you some how get this to work, I see an Aimbot coming.
There already is an aimbot, just no walkbot.

One was made by rudy, badspot removed thread a while ago.

If you some how get this to work, I see an Aimbot coming.
There already is an aimbot, just no walkbot.
No I mean a script that allows players to use an "aimbot" which pretty much targets the centre of the player.

If you some how get this to work, I see an Aimbot coming.
There already is an aimbot, just no walkbot.
No I mean a script that allows players to use an "aimbot" which pretty much targets the centre of the player.
I know what you mean.