local y=char.RightUpperArm.RightShoulder local P=char.LeftUpperArm.LeftShoulder local X=char.RightUpperLeg:WaitForChild("\082\105\103\104\116\072\105\112")local C=char.LeftUpperLeg:WaitForChild("\076\101\102\116\072\105\112")local D=char.LeftUpperLeg local U=char.RightUpperLeg function Stand()Humanoid.CameraOffset=Vector3.new(0,.7,0)Humanoid.WalkSpeed=16 IsStanced=false for y,P in pairs(Torso:GetChildren())do if P.Name=="\076\101\103\087\101\108\100"and P.ClassName=="\087\101\108\100"then P:Destroy()end end C.Part1=D X.Part1=U Proned2=Vector3.new(0,0,0)tweenJoint(RootJoint,CFrame.new()*CFrame.Angles(math.rad(0),0,math.rad(0)),CFrame.new(0,0,0),function(y)return math.sin(math.rad(y))end,.25)tweenJoint(X,CFrame.new(.4,0,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),nil,function(y)return math.sin(math.rad(y))end,0)tweenJoint(C,CFrame.new(-0.4,0,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),nil,function(y)return math.sin(math.rad(y))end,0)tweenJoint(y,CFrame.new(.85,.5,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),nil,function(y)return math.sin(math.rad(y))end,.25)tweenJoint(P,CFrame.new(-0.85,.5,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),nil,function(y)return math.sin(math.rad(y))end,.25)end function LeanRight()Humanoid.CameraOffset=Vector3.new(.5,-0.35,0)Humanoid.WalkSpeed=9 IsStanced=true Proned2=Vector3.new(0,0,0)X.Part1=nil CreateWeld(U,CFrame.new(-0.2,1.85,.3)*CFrame.Angles(math.rad(0),0,math.rad(-20)))tweenJoint(RootJoint,CFrame.new(.1,-0.25,0)*CFrame.Angles(math.rad(0),0,math.rad(-20)),CFrame.new(0,0,0),function(y)return math.sin(math.rad(y))end,.25)end function LeanLeft()Humanoid.CameraOffset=Vector3.new(-0.5,-0.35,0)Humanoid.WalkSpeed=9 IsStanced=true Proned2=Vector3.new(0,0,0)C.Part1=nil CreateWeld(D,CFrame.new(.2,1.85,.3)*CFrame.Angles(math.rad(0),0,math.rad(20)))tweenJoint(RootJoint,CFrame.new(-0.1,-0.25,0)*CFrame.Angles(math.rad(0),0,math.rad(20)),CFrame.new(0,0,0),function(y)return math.sin(math.rad(y))end,.25)end function Crouch()Humanoid.CameraOffset=Vector3.new(0,-1,0)Humanoid.WalkSpeed=9 for y,P in pairs(Torso:GetChildren())do if P.Name=="\076\101\103\087\101\108\100"and P.ClassName=="\087\101\108\100"then P:Destroy()end end IsStanced=true X.Part1=U C.Part1=D Proned2=Vector3.new(0,0,0)tweenJoint(RootJoint,CFrame.new(0,-1,0)*CFrame.Angles(math.rad(0),0,math.rad(0)),CFrame.new(0,0,0),function(y)return math.sin(math.rad(y))end,.25)tweenJoint(X,CFrame.new(1,-0.15,-0.65)*CFrame.Angles(math.rad(-20),math.rad(90),math.rad(0)),nil,function(y)return math.sin(math.rad(y))end,.25)tweenJoint(C,CFrame.new(-1,-0.675,-0.625)*CFrame.Angles(math.rad(-60),math.rad(-90),math.rad(0)),nil,function(y)return math.sin(math.rad(y))end,.25)tweenJoint(y,CFrame.new(1,.5,0)*CFrame.Angles(math.rad(0),math.rad(-45),math.rad(0)),nil,function(y)return math.sin(math.rad(y))end,.25)tweenJoint(P,CFrame.new(-1,.5,0)*CFrame.Angles(math.rad(0),math.rad(45),math.rad(0)),nil,function(y)return math.sin(math.rad(y))end,.25)end function Prone()Humanoid.CameraOffset=Vector3.new(0,-3.5,0)Humanoid.WalkSpeed=4 IsStanced=true X.Part1=nil C.Part1=nil Proned2=Vector3.new(0,.5,.5)tweenJoint(RootJoint,CFrame.new(0,-2.5,1)*CFrame.Angles(math.rad(-90),0,math.rad(0)),nil,function(y)return math.sin(math.rad(y))end,.25)tweenJoint(y,CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),nil,function(y)return math.sin(math.rad(y))end,.25)tweenJoint(P,CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),nil,function(y)return math.sin(math.rad(y))end,0)CreateWeld(U,CFrame.new(-0.2,1.85,0)*CFrame.Angles(math.rad(0),0,math.rad(-20)))CreateWeld(D,CFrame.new(.2,1.85,0)*CFrame.Angles(math.rad(0),0,math.rad(20)))end local m=false mouse.KeyDown:connect(function(y)if y=="\099"and(Stances==0 and(not _G.Sprinting and not _G.Lean))then Stances=1 Crouch()_G.Crouched=true elseif y=="\099"and(Stances==1 and(not _G.Sprinting and not _G.Lean))then Stances=2 Prone()_G.Crouched=false _G.Proned=true m=true elseif y=="\120"and(Stances==2 and(not _G.Sprinting and not _G.Lean))then m=false _G.Crouched=true _G.Proned=false Stances=1 Crouch()elseif y=="\120"and(Stances==1 and(not _G.Sprinting and not _G.Lean))then _G.Crouched=false Stances=0 Stand()end if y=="\101"and(not _G.Lean and(Stances==0 and not _G.Sprinting))then LeanRight()_G.Lean=true end if y=="\113"and(not _G.Lean and(Stances==0 and not _G.Sprinting))then LeanLeft()_G.Lean=true end end)mouse.KeyUp:connect(function(y)if y=="\101"and(_G.Lean and(Stances==0 and not _G.Sprinting))then Stand()_G.Lean=false end if y=="\113"and(_G.Lean and(Stances==0 and not _G.Sprinting))then Stand()_G.Lean=false end end)Stand()

local RS = char.RightUpperArm["RightShoulder"]
local LS = char.LeftUpperArm["LeftShoulder"]
local RH = char["RightUpperLeg"]:WaitForChild("RightHip")
local LH = char["LeftUpperLeg"]:WaitForChild("LeftHip")
local LeftLeg = char["LeftUpperLeg"]
local RightLeg = char["RightUpperLeg"]--[[
ttt = Instance.new("Weld",Character.Head)
ttt.Part0 = Character.Head
ttt.Part1 = Character.UpperTorso
--]]
function Stand()
	Humanoid.CameraOffset = Vector3.new(0, .7, 0)
	Humanoid.WalkSpeed = 16
	IsStanced = false	
	for i, s in pairs(Torso:GetChildren()) do
		if (s.Name == "LegWeld") and (s.ClassName == "Weld") then
			s:Destroy()
		end
	end
	LH.Part1 = LeftLeg
	RH.Part1 = RightLeg
	Proned2 = Vector3.new(0,0,0)
	tweenJoint(RootJoint, CFrame.new()* CFrame.Angles(math.rad(-0),0,math.rad(0)), CFrame.new(0,0,0), function(X) return math.sin(math.rad(X)) end, 0.25)
	tweenJoint(RH, CFrame.new(.4,0,0)* CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)), nil, function(X) return math.sin(math.rad(X)) end, 0)
	tweenJoint(LH, CFrame.new(-.4,0,0)* CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)), nil, function(X) return math.sin(math.rad(X)) end, 0)
	tweenJoint(RS, CFrame.new(.85,0.5,0)* CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)), nil, function(X) return math.sin(math.rad(X)) end, 0.25)
	tweenJoint(LS, CFrame.new(-.85,0.5,0)* CFrame.Angles(math.rad(0),math.rad(-0),math.rad(0)), nil, function(X) return math.sin(math.rad(X)) end, 0.25)
end

function LeanRight()
	Humanoid.CameraOffset = Vector3.new(0.5, -0.35, 0)
	Humanoid.WalkSpeed = 9
	IsStanced = true	
	Proned2 = Vector3.new(0,0,0)
	RH.Part1 = nil
	CreateWeld(RightLeg, CFrame.new(-0.2,1.85,0.3)* CFrame.Angles(math.rad(-0),0,math.rad(-20)))
	tweenJoint(RootJoint, CFrame.new(0.1,-0.25,0)* CFrame.Angles(math.rad(-0),0,math.rad(-20)), CFrame.new(0,0,0), function(X) return math.sin(math.rad(X)) end, 0.25)
end

function LeanLeft()
	Humanoid.CameraOffset = Vector3.new(-0.5, -0.35, 0)
	Humanoid.WalkSpeed = 9
	IsStanced = true	
	Proned2 = Vector3.new(0,0,0)
	LH.Part1 = nil
	CreateWeld(LeftLeg, CFrame.new(0.2,1.85,0.3)* CFrame.Angles(math.rad(-0),0,math.rad(20)))
	tweenJoint(RootJoint, CFrame.new(-0.1,-0.25,0)* CFrame.Angles(math.rad(-0),0,math.rad(20)), CFrame.new(0,0,0), function(X) return math.sin(math.rad(X)) end, 0.25)
end

function Crouch()
	Humanoid.CameraOffset = Vector3.new(0, -1, 0)
	Humanoid.WalkSpeed = 9
	for i, s in pairs(Torso:GetChildren()) do
		if (s.Name == "LegWeld") and (s.ClassName == "Weld") then
			s:Destroy()
		end
	end
	IsStanced = true	
	RH.Part1 = RightLeg
	LH.Part1 = LeftLeg
	Proned2 = Vector3.new(0,0,0)
	tweenJoint(RootJoint, CFrame.new(0,-1,0)* CFrame.Angles(math.rad(-0),0,math.rad(0)), CFrame.new(0,0,0), function(X) return math.sin(math.rad(X)) end, 0.25)
	tweenJoint(RH, CFrame.new(1,-0.15,-0.65)* CFrame.Angles(math.rad(-20),math.rad(90),math.rad(0)), nil, function(X) return math.sin(math.rad(X)) end, 0.25)
	tweenJoint(LH, CFrame.new(-1,-0.675,-0.625)* CFrame.Angles(math.rad(-60),math.rad(-90),math.rad(0)), nil, function(X) return math.sin(math.rad(X)) end, 0.25)
	tweenJoint(RS, CFrame.new(1,0.5,0)* CFrame.Angles(math.rad(0),math.rad(-45),math.rad(0)), nil, function(X) return math.sin(math.rad(X)) end, 0.25)
	tweenJoint(LS, CFrame.new(-1,0.5,0)* CFrame.Angles(math.rad(0),math.rad(45),math.rad(0)), nil, function(X) return math.sin(math.rad(X)) end, 0.25)
end

function Prone()
	Humanoid.CameraOffset = Vector3.new(0, -3.5, 0)
	Humanoid.WalkSpeed = 4
	IsStanced = true
	RH.Part1 = nil
	LH.Part1 = nil
	Proned2 = Vector3.new(0,0.5,0.5)
	tweenJoint(RootJoint, CFrame.new(0,-2.5,1)* CFrame.Angles(math.rad(-90),0,math.rad(0)), nil, function(X) return math.sin(math.rad(X)) end, 0.25)
	tweenJoint(RS, CFrame.new(0,0,0)* CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)), nil, function(X) return math.sin(math.rad(X)) end, 0.25)
	tweenJoint(LS, CFrame.new(0,0,0)* CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)), nil, function(X) return math.sin(math.rad(X)) end, 0)
	CreateWeld(RightLeg, CFrame.new(-0.2,1.85,0)* CFrame.Angles(math.rad(-0),0,math.rad(-20)))
	CreateWeld(LeftLeg, CFrame.new(0.2,1.85,0)* CFrame.Angles(math.rad(-0),0,math.rad(20)))
end

local AlreadyProned = false
	mouse.KeyDown:connect(function(Key)
		if Key == "c" and Stances == 0 and not _G.Sprinting and not _G.Lean then
			Stances = 1
			Crouch()
			_G.Crouched = true
		elseif Key == "c" and Stances == 1 and not _G.Sprinting and not _G.Lean   then	
			Stances = 2
			Prone()
			_G.Crouched = false
			_G.Proned = true
			AlreadyProned = true
		elseif Key == "x" and Stances == 2 and not _G.Sprinting and not _G.Lean   then
			AlreadyProned = false	
			_G.Crouched = true
			_G.Proned = false
			Stances = 1
			Crouch()
		elseif Key == "x" and Stances == 1 and not _G.Sprinting and not _G.Lean   then		
			_G.Crouched = false
			Stances = 0
			Stand()
		end
		if Key == "e" and not _G.Lean and Stances == 0 and not _G.Sprinting  then
			LeanRight()
			_G.Lean = true
		end
		if Key == "q" and not _G.Lean and Stances == 0 and not _G.Sprinting   then
			LeanLeft()
			_G.Lean = true
		end
	end)
	mouse.KeyUp:connect(function(Key)
		if Key == "e" and _G.Lean and Stances == 0 and not _G.Sprinting   then
			Stand()
			_G.Lean = false
		end
		if Key == "q" and _G.Lean and Stances == 0 and not _G.Sprinting   then
			Stand()
			_G.Lean = false
		end
	end)
	
Stand()
