Universal Script 📌
7.3k Views
579 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
Script hub
2.0M
626.6k
Bumped 10 minutes ago
Key System
Script hub
202.4k
2.3M
Bumped 2 hours ago
Key System

Script hub

#20 this week

Verified script badgeAirflow HUB

Universal Script 📌
57.4k
270.2k
Bumped 4 hours ago
Key System
Script hub
2.2M
2.5M
Bumped 7 hours ago
Key System
Universal Script 📌
33.4k
479.6k
Bumped 7 hours ago
Script hub
4.0M
2.7M
Bumped 7 hours ago

Script hub

Hall of Fame #5

KeylessVerified script badge[KEYLESS] Moondiety Script | 30+ supported Games