Universal Script 📌
7.2k Views
422 Executions

head movement

Universal Script 📌
Flipflop
FlipflopPublished 10
5 years 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

head mvoement

Updates

  1. Script edited: Create script

View Raw
local Camera = workspace.CurrentCamera
local Player = game.Players.LocalPlayer

local Character = Player.Character
local Root = Character:WaitForChild("HumanoidRootPart")
local Neck = Character:FindFirstChild("Neck", true)
local YOffset = Neck.C0.Y

local CFNew, CFAng = CFrame.new, CFrame.Angles
local asin = math.asin

game:GetService("RunService").RenderStepped:Connect(function()
    local CameraDirection = Root.CFrame:toObjectSpace(Camera.CFrame).lookVector
    if Neck then
		if Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
        	Neck.C0 = CFNew(0, YOffset, 0) * CFAng(0, -asin(CameraDirection.x), 0) * CFAng(asin(CameraDirection.y), 0, 0)
		elseif Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
			Neck.C0 = CFNew(0, YOffset, 0) * CFAng(3 * math.pi/2, 0, math.pi) * CFAng(0, 0, -asin(CameraDirection.x)) * CFAng(-asin(CameraDirection.y), 0, 0)
		end
    end
end)


Comments

1
Log in to join the conversation. Login
piska*213's profile picture
piska*2132 years ago(edited)

FE?

1

More universal scripts

See all
Universal Script 📌
597.5k
4.2M
Bumped 3 minutes ago
Script hub
50.7k
320.1k
Bumped 2 hours ago

Script hub

Nameless Admin

Script hub
176.7k
1.6M
Bumped 3 hours ago
Key System
Script hub
46.6k
11.5k
Bumped 5 hours ago
Key System
Paid
Script hub
2.5M
798.8k
Bumped 6 hours ago
Key System

Script hub

#6 today

Verified script badgeLumin Hub | #1 | Insta Steal