Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function StartTest()
- local Yourself = LocalPlayer()
- Yourself.LimitAngle = Yourself:EyeAngles().y
- Yourself.Test = true
- end
- concommand.Add("StartTest",StartTest)
- function EndTest()
- LocalPlayer().Test = false
- end
- concommand.Add("EndTest",EndTest)
- function LimitDeployAngle(UCMD)
- local Yourself = LocalPlayer()
- local Weapon = Yourself:GetActiveWeapon()
- if Yourself.Test == true then
- local ang = UCMD:GetViewAngles()
- local PAng = math.AngleDifference(Yourself.LimitAngle,Yourself:EyeAngles().y)
- if PAng >= 55 then
- ang.y = Yourself.LimitAngle + PAng
- UCMD:SetViewAngles(ang)
- end
- if PAng <= 55 then
- ang.y = Yourself.LimitAngle - PAng
- UCMD:SetViewAngles(ang)
- end
- end
- end
- hook.Add("CreateMove", "LimitDeployAngleHook", LimitDeployAngle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement