Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local P = FindMetaTable("Player")
- local ply = FindMetaTable("Player")
- function SCHEMA:KeyPress( ply, KEY )
- local ent = ply:GetEyeTrace().Entity
- if SERVER and (KEY == IN_USE) then
- ply:SetAnimation(ACT_RUN)
- if ent:IsPlayer() then
- local pos = ent:GetPos()
- ent:SetPos(pos)
- umsg.Start("exp_choke",ent)
- umsg.Bool(true)
- umsg.End()
- timer.Simple(0.1,function()
- umsg.Start("exp_choke",ent)
- umsg.Bool(false)
- umsg.End()
- end)
- ent:SetMoveType(MOVETYPE_NOCLIP)
- ent:Lock()
- timer.Create(ent:SteamID().."forcechoke",0.01,50,function()
- ent:SetPos(ent:GetPos() + Vector(0,0,1))
- end)
- timer.Create(ent:SteamID().."forcechoke2",1,5,function()
- if ent:Health() <= 10 then
- ent:Kill()
- timer.Destroy(ent:SteamID().."forcechoke2")
- else
- ent:SetHealth(ent:Health()-10)
- ent:SendLua("surface.PlaySound(\"player/pl_drown1.wav\")")
- umsg.Start("exp_choke",ent)
- umsg.Bool(true)
- umsg.End()
- timer.Simple(0.1,function()
- umsg.Start("exp_choke",ent)
- umsg.Bool(false)
- umsg.End()
- end)
- end
- end)
- timer.Simple(5,function()
- ent:UnLock()
- ent:SetMoveType(MOVETYPE_WALK)
- end)
- end
- end
- if ( CLIENT) then
- usermessage.Hook("exp_choke",function(u)
- choke = u:ReadBool()
- curtime = SysTime()
- end)
- end
- if( KEY == IN_JUMP ) then
- if( ply:Team() == FACTION_CLONE ) then
- ply.ConstJump = true
- if( ply:IsOnGround() ) then
- ply.JumpPhase = 1
- elseif( ply:GetNWInt("Force") >= 25 and ply.JumpPhase == 1 ) then
- ply.NoFallDamage = true
- ply:SetNWInt("Force",ply:GetNWInt("Force")-1)
- ply:SetVelocity( ply:GetUp() * 350 )
- ply:EmitSound( "starwarssound/jump.wav" )
- timer.Create( "ForceJumpConstTimer", 0.01, 0, function()
- if( ( ply:GetNWInt("Force") < 5 ) or !ply.ConstJump ) then
- ply:PrintMessage( HUD_PRINTCENTER, "No moar jump :C" )
- ply:SetVelocity( Vector( 0, 0, 0 ) )
- timer.Destroy( "ForceJumpConstTimer" )
- ply:SetNWInt("Force",ply:GetNWInt("Force")-0)
- ply.JumpPhase = false
- end
- ply:SetNWInt("Force",ply:GetNWInt("Force")-0)
- ply:SetVelocity( ply:GetUp() * 10 )
- end )
- ply.JumpPhase = 2
- elseif( ply:GetNWInt("Force") >= 5 and ply.JumpPhase == 2 ) then
- timer.Create( "ForceJumpConstTimer", 0.1, 0, function()
- if( ( ply:GetNWInt("Force") < 5 ) or !ply.ConstJump ) then
- ply:PrintMessage( HUD_PRINTCENTER, "No moar jump :C" )
- ply:SetVelocity( Vector( 0, 0, 0 ) )
- timer.Destroy( "ForceJumpConstTimer" )
- ply:SetNWInt("Force",ply:GetNWInt("Force")-0)
- end
- ply:SetNWInt("Force",ply:GetNWInt("Force")-0)
- ply:SetVelocity( ply:GetUp() * 10 )
- end )
- end
- end
- elseif( KEY == IN_SPEED and ply:KeyDown( IN_FORWARD ) ) then
- ply.ConstSprint = true
- if( ply:Team() == FACTION_CLONE ) then
- if( ply:GetNWInt("Force") >= 10 and !ply:IsOnGround() ) then
- elseif( ply:GetNWInt("Force") >= 10 and ply:IsOnGround() ) then
- ply:EmitSound( "starwarssound/speed.wav" )
- timer.Create( "ForceSprintConstTimer", 0.1, 0, function()
- if( ( ply:GetNWInt("Force") < 5 ) ) then//or !ply.ConstSprint or !ply:IsOnGround() ) then
- ply:PrintMessage( HUD_PRINTCENTER, "No moar force :S" )
- ply:SetVelocity( Vector( 0, 0, 0 ) )
- timer.Destroy( "ForceSprintConstTimer" )
- ply:SetNWInt("Force",ply:GetNWInt("Force")-0)
- end
- ply:SetNWInt("Force",ply:GetNWInt("Force")-1)
- ply:SetRunSpeed(800)
- end )
- end
- end
- elseif ( KEY == IN_USE ) and ply:GetPos():WithinAABox(Vector(-1903.97,-384.00,-4799.97),Vector(-1849.11,-386.03,-4799.97)) then
- ply:SetPos(Vector(-2028.63,-476.51,-4774.08))
- end
- end
- function SCHEMA:KeyRelease( ply, KEY )
- if( KEY == IN_SPEED ) then
- ply.ConstSprint = false
- timer.Destroy( "ForceSprintConstTimer" )
- timer.Create("StaminaRestore",0.6,0,function()
- if(ply:GetNWInt("Force") < 100) then
- ply:SetNWInt("Force",ply:GetNWInt("Force")+1)
- if (ply:GetNWInt("Force") > 100 )then
- timer.Destroy("StaminaRestore")
- end
- end
- end)
- if( KEY == IN_JUMP ) then
- end
- ply.ConstJump = false
- timer.Destroy( "ForceJumpConstTimer" )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement