All pastes #30972 Raw Edit

Someone

public text v1 · immutable
#30972 ·published 2005-11-24 20:52 UTC
rendered paste body
vecDown = vector3(0, 0, -1);
vecForceScale = vector3(500, 500, 500);
vecForceUp = vector3(0, 0, 500);
nextJumpTime = 0;

function onThink( )
	if _PlayerIsKeyDown(Owner, 8192) then
		local curTime = _CurTime()
		if(curTime >= nextJumpTime) then
			--see if the player is on the ground
			_TraceLine(_PlayerGetShootPos(Owner), vecDown, 64, Owner);
			
			if _TraceHitWorld() then
				local vecJumpVel = vecMul(_PlayerGetShootAng(Owner), vecForceScale);
				_EntSetVelocity(Owner, vecJumpVel);
			end
			
			nextJumpTime = curTime + 1;
		end
	end
end