Advertisement
sparkspg

Untitled

May 18th, 2014
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.19 KB | None | 0 0
  1.  
  2. local P = FindMetaTable("Player")
  3. local ply = FindMetaTable("Player")
  4.  
  5. function SCHEMA:KeyPress( ply, KEY )
  6. local ent = ply:GetEyeTrace().Entity
  7.  if SERVER and (KEY == IN_USE) then
  8.     ply:SetAnimation(ACT_RUN)
  9.     if ent:IsPlayer() then
  10.     local pos = ent:GetPos()
  11.             ent:SetPos(pos)
  12.             umsg.Start("exp_choke",ent)
  13.                 umsg.Bool(true)
  14.             umsg.End()
  15.             timer.Simple(0.1,function()
  16.                     umsg.Start("exp_choke",ent)
  17.                         umsg.Bool(false)
  18.                     umsg.End()
  19.                 end)
  20.             ent:SetMoveType(MOVETYPE_NOCLIP)
  21.             ent:Lock()
  22.        
  23.             timer.Create(ent:SteamID().."forcechoke",0.01,50,function()
  24.                 ent:SetPos(ent:GetPos() + Vector(0,0,1))
  25.             end)
  26.             timer.Create(ent:SteamID().."forcechoke2",1,5,function()
  27.                 if ent:Health() <= 10 then
  28.                     ent:Kill()
  29.                     timer.Destroy(ent:SteamID().."forcechoke2")
  30.                 else
  31.                     ent:SetHealth(ent:Health()-10)
  32.                     ent:SendLua("surface.PlaySound(\"player/pl_drown1.wav\")")
  33.                     umsg.Start("exp_choke",ent)
  34.                         umsg.Bool(true)
  35.                     umsg.End()
  36.                     timer.Simple(0.1,function()
  37.                         umsg.Start("exp_choke",ent)
  38.                             umsg.Bool(false)
  39.                         umsg.End()
  40.                     end)
  41.                 end
  42.             end)
  43.             timer.Simple(5,function()
  44.                 ent:UnLock()
  45.                 ent:SetMoveType(MOVETYPE_WALK)
  46.                
  47.             end)
  48.         end
  49.         end
  50.  if ( CLIENT)  then
  51. usermessage.Hook("exp_choke",function(u)
  52.     choke = u:ReadBool()
  53.     curtime = SysTime()
  54. end)
  55. end
  56.    
  57.     if( KEY == IN_JUMP ) then
  58.         if( ply:Team() == FACTION_CLONE ) then
  59.             ply.ConstJump = true
  60.             if( ply:IsOnGround() ) then
  61.                 ply.JumpPhase = 1
  62.             elseif( ply:GetNWInt("Force") >= 25 and ply.JumpPhase == 1 ) then
  63.                 ply.NoFallDamage = true
  64.                 ply:SetNWInt("Force",ply:GetNWInt("Force")-1)
  65.                 ply:SetVelocity( ply:GetUp() * 350 )
  66.                 ply:EmitSound( "starwarssound/jump.wav" )
  67.                 timer.Create( "ForceJumpConstTimer", 0.01, 0, function()
  68.                     if( ( ply:GetNWInt("Force") < 5  ) or !ply.ConstJump ) then
  69.                         ply:PrintMessage( HUD_PRINTCENTER, "No moar jump :C" )
  70.                         ply:SetVelocity( Vector( 0, 0, 0 ) )
  71.                         timer.Destroy( "ForceJumpConstTimer" )
  72.                         ply:SetNWInt("Force",ply:GetNWInt("Force")-0)
  73.                         ply.JumpPhase = false
  74.                     end
  75.                     ply:SetNWInt("Force",ply:GetNWInt("Force")-0)
  76.                     ply:SetVelocity( ply:GetUp() * 10 )
  77.                 end )
  78.                 ply.JumpPhase = 2
  79.             elseif(  ply:GetNWInt("Force") >= 5 and ply.JumpPhase == 2 ) then
  80.                 timer.Create( "ForceJumpConstTimer", 0.1, 0, function()
  81.                     if( ( ply:GetNWInt("Force") < 5 ) or !ply.ConstJump ) then
  82.                         ply:PrintMessage( HUD_PRINTCENTER, "No moar jump :C" )
  83.                         ply:SetVelocity( Vector( 0, 0, 0 ) )
  84.                         timer.Destroy( "ForceJumpConstTimer" )
  85.                         ply:SetNWInt("Force",ply:GetNWInt("Force")-0)
  86.                     end
  87.                 ply:SetNWInt("Force",ply:GetNWInt("Force")-0)
  88.                     ply:SetVelocity( ply:GetUp() * 10 )
  89.                 end )
  90.             end
  91.         end
  92.     elseif( KEY == IN_SPEED and ply:KeyDown( IN_FORWARD ) ) then
  93.         ply.ConstSprint = true
  94.         if( ply:Team() == FACTION_CLONE ) then
  95.             if( ply:GetNWInt("Force") >= 10 and !ply:IsOnGround() ) then
  96.             elseif(  ply:GetNWInt("Force") >= 10 and ply:IsOnGround() ) then
  97.                 ply:EmitSound( "starwarssound/speed.wav" )
  98.                 timer.Create( "ForceSprintConstTimer", 0.1, 0, function()
  99.                     if( ( ply:GetNWInt("Force")  < 5 ) ) then//or !ply.ConstSprint or !ply:IsOnGround() ) then
  100.                         ply:PrintMessage( HUD_PRINTCENTER, "No moar force :S" )
  101.                         ply:SetVelocity( Vector( 0, 0, 0 ) )
  102.                         timer.Destroy( "ForceSprintConstTimer" )
  103.                         ply:SetNWInt("Force",ply:GetNWInt("Force")-0)
  104.                     end
  105.                     ply:SetNWInt("Force",ply:GetNWInt("Force")-1)
  106.                     ply:SetRunSpeed(800)
  107.                 end )
  108.             end
  109.         end
  110.     elseif ( KEY == IN_USE  ) and ply:GetPos():WithinAABox(Vector(-1903.97,-384.00,-4799.97),Vector(-1849.11,-386.03,-4799.97)) then
  111.              ply:SetPos(Vector(-2028.63,-476.51,-4774.08)) 
  112.             end
  113. end
  114.  
  115. function SCHEMA:KeyRelease( ply, KEY )
  116.     if( KEY == IN_SPEED ) then
  117.         ply.ConstSprint = false
  118.         timer.Destroy( "ForceSprintConstTimer" )
  119.         timer.Create("StaminaRestore",0.6,0,function()
  120.         if(ply:GetNWInt("Force") < 100) then
  121.             ply:SetNWInt("Force",ply:GetNWInt("Force")+1)
  122.             if (ply:GetNWInt("Force") > 100 )then
  123.             timer.Destroy("StaminaRestore")
  124.             end
  125.             end
  126.             end)
  127.            
  128.     if( KEY == IN_JUMP ) then
  129.     end
  130.         ply.ConstJump = false
  131.         timer.Destroy( "ForceJumpConstTimer" )
  132.     end
  133. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement