Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. local function StartTest()
  2. local Yourself = LocalPlayer()
  3. Yourself.LimitAngle = Yourself:EyeAngles().y
  4. Yourself.Test = true
  5. end
  6. concommand.Add("StartTest",StartTest)
  7.  
  8. function EndTest()
  9. LocalPlayer().Test = false
  10. end
  11. concommand.Add("EndTest",EndTest)
  12.  
  13. function LimitDeployAngle(UCMD)
  14. local Yourself = LocalPlayer()
  15. local Weapon = Yourself:GetActiveWeapon()
  16. if Yourself.Test == true then
  17. local ang = UCMD:GetViewAngles()
  18. local PAng = math.AngleDifference(Yourself.LimitAngle,Yourself:EyeAngles().y)
  19. if PAng >= 55 then
  20. ang.y = Yourself.LimitAngle + PAng
  21. UCMD:SetViewAngles(ang)
  22. end
  23. if PAng <= 55 then
  24. ang.y = Yourself.LimitAngle - PAng
  25. UCMD:SetViewAngles(ang)
  26. end
  27. end
  28. end
  29. hook.Add("CreateMove", "LimitDeployAngleHook", LimitDeployAngle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement