Game Development Community

How to lock the players feet down with melee

by Jason Davis · in Torque Game Engine · 12/27/2006 (3:44 pm) · 1 replies

I am wanting to know how to lock the player in place (so he can't run around) while swinging a melee weapon. I saw one example (in a forum post I cannot find again, for some reason) of a method used like this:

%player.setMaxSpeed("0 0 0");

But TGE 1.5 says that their is no such function. I have searched the web site for hours and cannot find any hint as to what I can do. I know that the speed is defined in the player's datablock but there MUST be some way to change it mid-stream.

Any info on this is greatly appreciated!!! :-)
Jason

#1
01/16/2007 (6:20 am)
Not sure if you've solved this or given up, but a player object should have 6 script fields related to maxSpeed:

  • horizMaxSpeed[li]horizResistSpeed[li]horizResistFactor[li]upMaxSpeed[li]upResistSpeed[li]upResistFactor
Try this:
function servercmdLockPlayer(%client)
{
    %client.player.horizMaxSpeed = 0;
    %client.player.upMaxSpeed = 0;
}