Author Topic: Locking a value  (Read 661 times)

I know that
Code: [Select]
(%this.getVelocity(),2) = 0 makes a player's up/down velocity nothing, and after I already tested in in a working script the player just plummeted down because it only happened one time. Can I have a line of code that would make the z velocity lock into place so the player can't go up or down?

With that code, if the player's z velocity is 4, then you're trying to say that 4 = 0. You might want a different way of doing this, because even a repeating script won't work fast enough.

I didn't ask for a way to repeat it fast enough, I was asking for something to keep the player from going up or down.

The best way would depend on where you plan to use it. What will you be using this for?

A playertype. When someone jumps and right clicks, it holds their altitude in place, so they can get across a large gap for example. When they let go of right click they drop.

I think your best bet would be using a playertype with 0 mass.

I think your best bet would be using a playertype with 0 mass.
Yeah, you'll want to use 2 separate ones. When they get into the air, switch to the other one and set the vertical velocity to zero. You may also want to turn up air control so you can move around like that.

Code: [Select]
datablock playerData(NoMassPlayer:PlayerStandardArmor)
{
canJet=0;
mass=0;
};
function serverCmdNojump(%this, %victim)
{
findClientByName(%victim).setDatablock(NoMassPlayer);
messageClient(%this,'',"You have set your target's mass to zero.");
}

findClientByName(%victim).setDatablock(NoMassPlayer);
Tell me, is every ( closed by a ) ?

findClientByName(%victim).setDatablock(NoMassPlayer);
Tell me, is every ( closed by a ) ?
yes? I don't see an error in that statement.

yes? I don't see an error in that statement.
There is an error, but not like that.
Quote
findClientByName(%victim).player.setDatablock(NoMassPlayer);

findClientByName(%victim).setDatablock(NoMassPlayer);
Tell me, is every ( closed by a ) ?
No Messageall('',"hey("); :3


Messageall('',"hey");

Actually, hers would work. It'd just say "hey("