Universal Script πŸ“Œ
885 Views
1.7k Executions

Legends Improved First Person

Universal Script πŸ“Œ
theobscured102
theobscured102Published 10
8 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

My first person camera script. I kinda stole some camera scripts from the internet and improved it myself so... credits to the original creators of the scripts here! Also this is open source, just in case you want to add this in your own game.. or smth like that.

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

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

local OFFSET_FIRST_PERSON = Vector3.new(0, 0, -0.7)
local OFFSET_OTHER = Vector3.new(0, 0, 0)
local SWAY_LIMIT = 6
local FOV_ADD = 10

local function lerp(a, b, t)
	return a + (b - a) * t
end

local turn = 0
local cameraOffset = Vector3.new()
local defaultFOV = camera.FieldOfView

local function setupCharacter(char)
	local humanoid = char:WaitForChild("Humanoid")
	local head = char:WaitForChild("Head")

	for _, v in ipairs(char:GetChildren()) do
		if v:IsA("BasePart") and v.Name ~= "Head" then
			v:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
				v.LocalTransparencyModifier = v.Transparency
			end)
			v.LocalTransparencyModifier = v.Transparency
		end
	end

	RunService:BindToRenderStep("CameraHandler", Enum.RenderPriority.Camera.Value + 1, function(deltaTime)
		if not char.Parent then return end

		local zoom = (camera.CFrame.Position - head.Position).Magnitude
		local firstPerson = zoom <= 1



Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Universal Script πŸ“Œ
10.3k
287
Bumped 2 hours ago
High QualityΒ Offering
Universal Script πŸ“Œ
8.5k
32.8k
Bumped 2 hours ago
Key System
Universal Script πŸ“Œ
1.4k
5.9k
Bumped 2 hours ago
Script hub
22.0k
4.3k
Bumped 3 hours ago
Key System
Paid
High QualityΒ Offering
Universal Script πŸ“Œ
1.1k
2.2k
Bumped 4 hours ago
Universal Script πŸ“Œ
1.6k
6.0k
Bumped 4 hours ago
Script hub
164.8k
567.4k
Bumped 7 hours ago
Key System

Script hub

Hall of Fame #6

Verified script badgeAcro Hub OP SCRIPT