local l=true local O=100 local h=cam.FieldOfView local A=true local K=.25 local Q="\083\105\110\101"local f="\083\105\110\101"local C="\079\117\116"local V="\079\117\116"local H=players.LocalPlayer function SetProp(l,O,h,Q,f)if A==false then l[O]=h return end local C=TweenInfo.new(K,Enum.EasingStyle[Q],Enum.EasingDirection[f])local V={}V[O]=h local H=TweenService:Create(l,C,V)H:Play()end H.CharacterAdded:Connect(function(O)(O:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")).WalkSpeed=walkSpeed if l then SetProp(cam,"\070\105\101\108\100\079\102\086\105\101\119",h,f,V)end end)local function j(h,A)if not A then if h.UserInputType==Enum.UserInputType.Keyboard then local A=h.KeyCode if A==Enum.KeyCode.LeftShift then SetProp(H.Character.Humanoid,"\087\097\108\107\083\112\101\101\100",sprintSpeed,Q,C)if l then SetProp(cam,"\070\105\101\108\100\079\102\086\105\101\119",O,Q,C)end end end end end local function e(O,A)if not A then if O.UserInputType==Enum.UserInputType.Keyboard then local A=O.KeyCode if A==Enum.KeyCode.LeftShift then SetProp(H.Character.Humanoid,"\087\097\108\107\083\112\101\101\100",walkSpeed,f,V)if l then SetProp(cam,"\070\105\101\108\100\079\102\086\105\101\119",h,f,V)end end end end end userInput.InputBegan:Connect(j)userInput.InputEnded:Connect(e)
-- IF THIS IS TRUE, FOV WILL CHANGE WHEN YOU SPRINT/RUN
local changeFOV = true
local sprintFOV = 100
local walkFOV = cam.FieldOfView

local Tween = true
local TweenTime = 0.25

local SprintTweenStyle = "Sine"
local WalkTweenStyle = "Sine"
local SprintTweenDirection = "Out"
local WalkTweenDirection = "Out"

local player = players.LocalPlayer

function SetProp(Object, Property, Value, TweenStyle, TweenDirection)
	if Tween == false then
		Object[Property] = Value
		return
	end

	local tweenInfo = TweenInfo.new(TweenTime, Enum.EasingStyle[TweenStyle], Enum.EasingDirection[TweenDirection])
	local Goal = {}
	Goal[Property] = Value
	local tween = TweenService:Create(Object, tweenInfo, Goal)
	tween:Play()
end

player.CharacterAdded:Connect(function(Character)
	Character:FindFirstChildOfClass("Humanoid").WalkSpeed = walkSpeed

	if changeFOV then
		SetProp(cam, "FieldOfView", walkFOV, WalkTweenStyle, WalkTweenDirection)
	end
end)

local function beginSprint(input, gameProcessed)
	if not gameProcessed then
		if input.UserInputType == Enum.UserInputType.Keyboard then
			local keycode = input.KeyCode
			if keycode == Enum.KeyCode.LeftShift then
				SetProp(player.Character.Humanoid, "WalkSpeed", sprintSpeed, SprintTweenStyle, SprintTweenDirection)

				if changeFOV then
					SetProp(cam, "FieldOfView", sprintFOV, SprintTweenStyle, SprintTweenDirection)
				end
			end
		end
	end
end

local function endSprint(input, gameProcessed)
	if not gameProcessed then
		if input.UserInputType == Enum.UserInputType.Keyboard then
			local keycode = input.KeyCode
			if keycode == Enum.KeyCode.LeftShift then
				SetProp(player.Character.Humanoid, "WalkSpeed", walkSpeed, WalkTweenStyle, WalkTweenDirection)

				if changeFOV then
					SetProp(cam, "FieldOfView", walkFOV, WalkTweenStyle, WalkTweenDirection)
				end
			end
		end
	end
end

userInput.InputBegan:Connect(beginSprint)
userInput.InputEnded:Connect(endSprint)
