Back to Scripts
BodyCam visual

BodyCam visual

ScriptBlox
Universal Patched Free

Game: Universal Script 📌

291 Views
1 Likes
0 Dislikes
Argun

Argun

offline

Features

He make chatGPT PC recomended

Script Code

-- BODYCAM SCRIPT (Advanced)

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UIS = game:GetService("UserInputService")
local StarterGui = game:GetService("StarterGui")

local player = Players.LocalPlayer
local camera = workspace.CurrentCamera

-- ===== НАСТРОЙКИ =====
local BASE_FOV = 95
local RUN_FOV = 110

local sensitivity = 0.25
local smoothness = 0.12
local inertiaStrength = 0.08

local maxRoll = math.rad(6)
local rollSmoothness = 0.15

local idleShake = 0.12
local moveShake = 0.55
local shakeSpeed = 6

-- ===== СОСТОЯНИЯ =====
local character, humanoid, head
local mouseLocked = true
local bodycamEnabled = true
local guiHidden = false

local targetRotX, targetRotY = 0, 0
local rotX, rotY = 0, 0

local velocityX, velocityY = 0, 0
local roll = 0
local targetRoll = 0

-- ===== ФУНКЦИИ =====
local function setupCharacter(char)
	character = char
	humanoid = char:WaitForChild("Humanoid")
	head = char:WaitForChild("Head")

	for _, item in ipairs(char:GetDescendants()) do
		if item:IsA("Accessory") and item:FindFirstChild("Handle") then
			item.Handle.LocalTransparencyModifier = 1
		end
	end
end

local function setGuiVisible(state)
	guiHidden = not state

	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, state)

	for _, gui in ipairs(player.PlayerGui:GetChildren()) do
		if gui:IsA("ScreenGui") then
			gui.Enabled = state
		end
	end
end

-- ===== ИНИЦ =====
if player.Character then
	setupCharacter(player.Character)
end
player.CharacterAdded:Connect(setupCharacter)

camera.CameraType = Enum.CameraType.Scriptable
UIS.MouseBehavior = Enum.MouseBehavior.LockCenter

-- ===== ВВОД =====
UIS.InputBegan:Connect(function(input, gp)
	if gp then return end

	if input.KeyCode == Enum.KeyCode.P then
		mouseLocked = not mouseLocked
		UIS.MouseBehavior = mouseLocked and Enum.MouseBehavior.LockCenter or Enum.MouseBehavior.Default

	elseif input.KeyCode == Enum.KeyCode.O then
		bodycamEnabled = false
		camera.CameraType = Enum.CameraType.Custom
		UIS.MouseBehavior = Enum.MouseBehavior.Default

	elseif input.KeyCode == Enum.KeyCode.M then
		setGuiVisible(guiHidden)
	end
end)

UIS.InputChanged:Connect(function(input)
	if not bodycamEnabled then return end
	if input.UserInputType == Enum.UserInputType.MouseMovement and mouseLocked then
		targetRotY -= input.Delta.X * sensitivity * 0.002
		targetRotX -= input.Delta.Y * sensitivity * 0.002
		targetRotX = math.clamp(targetRotX, -1.3, 1.3)

		targetRoll = math.clamp(-input.Delta.X * 0.002, -maxRoll, maxRoll)
	end
end)

-- ===== ОБНОВЛЕНИЕ =====
RunService.RenderStepped:Connect(function(dt)
	if not bodycamEnabled then return end
	if not character or not head or not humanoid then return end

	-- ИНЕРЦИЯ
	velocityX += (targetRotX - rotX) * inertiaStrength
	velocityY += (targetRotY - rotY) * inertiaStrength

	velocityX *= 0.85
	velocityY *= 0.85

	rotX += velocityX
	rotY += velocityY

	-- НАКЛОН
	roll += (targetRoll - roll) * rollSmoothness
	targetRoll *= 0.9

	-- ДВИЖЕНИЕ
	local speed = humanoid.MoveDirection.Magnitude
	local shakeAmount = speed > 0 and moveShake or idleShake

	-- ТРЯСКА
	local t = tick()
	local shakeX = math.sin(t * shakeSpeed) * shakeAmount
	local shakeY = math.cos(t * shakeSpeed * 0.9) * shakeAmount

	-- FOV
	local targetFOV = speed > 0 and RUN_FOV or BASE_FOV
	camera.FieldOfView += (targetFOV - camera.FieldOfView) * 0.1

	camera.CFrame =
		head.CFrame
		* CFrame.Angles(
			rotX + math.rad(shakeX),
			rotY + math.rad(shakeY),
			roll
		)
end)

Ratings & Reviews

No reviews yet. Be the first to review this script!

Comments (0)

Please login to comment

Login with Discord

Loading comments...