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