local i=true local l=100 local T=cam.FieldOfView local S=true local D=.25 local H="\083\105\110\101"local g="\083\105\110\101"local v="\079\117\116"local C="\079\117\116"local r=players.LocalPlayer function SetProp(i,l,T,H,g)if S==false then i[l]=T return end local v=TweenInfo.new(D,Enum.EasingStyle[H],Enum.EasingDirection[g])local C={}C[l]=T local r=TweenService:Create(i,v,C)r:Play()end r.CharacterAdded:Connect(function(l)(l:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")).WalkSpeed=walkSpeed if i then SetProp(cam,"\070\105\101\108\100\079\102\086\105\101\119",T,g,C)end end)local function R(T,S)if not S then if T.UserInputType==Enum.UserInputType.Keyboard then local S=T.KeyCode if S==Enum.KeyCode.LeftShift then SetProp(r.Character.Humanoid,"\087\097\108\107\083\112\101\101\100",sprintSpeed,H,v)if i then SetProp(cam,"\070\105\101\108\100\079\102\086\105\101\119",l,H,v)end end end end end local function c(l,S)if not S then if l.UserInputType==Enum.UserInputType.Keyboard then local S=l.KeyCode if S==Enum.KeyCode.LeftShift then SetProp(r.Character.Humanoid,"\087\097\108\107\083\112\101\101\100",walkSpeed,g,C)if i then SetProp(cam,"\070\105\101\108\100\079\102\086\105\101\119",T,g,C)end end end end end userInput.InputBegan:Connect(R)userInput.InputEnded:Connect(c)

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)
