#Head Turning Not Functioning

1 messages · Page 1 of 1 (latest)

hollow widget
#

I asked the assistant to create a script for me that adds head turning, but after a while. This happened.

glacial tiger
hollow widget
# glacial tiger what do u want us to do about it

I wanna use the script provided by someone, but Idk how to use it.

local cc = workspace.CurrentCamera
local plr = game.Players.LocalPlayer
local rs = game:GetService("RunService")
local event = game.ReplicatedStorage.DCS_ReplicatedStorage.Events.Head_Movement_Event
local hum = plr.Character:WaitForChild("Humanoid")
--local SS = game.ReplicatedStorage.UpdateNB--
local ts = game:GetService("TweenService")
--location of neck
--local test = game.Workspace.StarterCharacter.RootPart.Bone["Bone.001"]["Bone.002"]["Bone.003"]["Bone.004"]["Bone.005"]["Bone.009"]["Bone.006"]["Bone.008"]["Bone.007"]

local nb = plr.Character:WaitForChild("RootPart"):WaitForChild("Bone")["Bone.001"]["Bone.010"]["Bone.009"]["Bone.011"]["Bone.002"]
local nb2 = plr.Character:WaitForChild("RootPart"):WaitForChild("Bone")["Bone.001"]["Bone.010"]["Bone.009"]["Bone.011"]["Bone.002"]["Bone.016"]
local nb3 = plr.Character:WaitForChild("RootPart"):WaitForChild("Bone")["Bone.001"]["Bone.010"]["Bone.009"]["Bone.011"]["Bone.002"]["Bone.016"]["Bone.015"]["Bone.017"]
local originalNbCFrame = nb.CFrame
local originalNb2CFrame = nb2.CFrame
local originalNb3CFrame = nb3.CFrame
local nbY = nb.Position.Y
local nb2Y = nb2.Position.Y
local nb3Y = nb3.Position.Y

--localised global variables
local CFn, CFa, sin = CFrame.new, CFrame.Angles, math.asin

repeat wait() until nb

rs.RenderStepped:Connect(function()
if plr.Character:FindFirstChild("DCS_No_Change") and plr.Character:FindFirstChild("HumanoidRootPart") then
if plr.Character.DCS_No_Change.Status_Values.IsSleeping.Value == false and plr.Character.DCS_No_Change.Status_Values.IsTranqed.Value == false then
local camDirection = plr.Character.HumanoidRootPart.CFrame:ToObjectSpace(cc.CFrame).LookVector/2
if nb then
nb.CFrame = CFn(0,nbY,0) * CFa(0, 0, math.clamp(sin(camDirection.x), -math.pi/5,math.pi/5)) * CFa(-sin(camDirection.Y),0,0)
nb.CFrame = nb.CFrame
end
if nb2 then
nb2.CFrame = CFn(0,nb2Y,0) * CFa(0, 0, math.clamp(sin(camDirection.x), -math.pi/7, math.pi/7)) * CFa(math.clamp(-sin(camDirection.Y), -math.pi/6, math.pi/6),0,0)
nb2.CFrame = nb2.CFrame
end

        if nb3 then
            nb3.CFrame = CFn(0,nb3Y,0) * CFa(0, 0, math.clamp(sin(camDirection.x), -math.pi/7, math.pi/7)) * CFa(-sin(camDirection.Y),0,0)
        end
    else
        game:GetService("TweenService"):Create(nb,TweenInfo.new(0.8), {CFrame = originalNbCFrame}):Play()
        game:GetService("TweenService"):Create(nb2,TweenInfo.new(0.8), {CFrame = originalNb2CFrame}):Play()
        game:GetService("TweenService"):Create(nb3,TweenInfo.new(0.8), {CFrame = originalNb3CFrame}):Play()
    end

end

end)

--[[SS.OnClientEvent:Connect(function(plr2, nb) --nb3
local nb = plr2.Character:FindFirstChild("RootPart").Bone["Bone.001"]["Bone.002"]["Bone.003"]:FindFirstChild("Bone.004", true)
local nb2 = plr2.Character:FindFirstChild("RootPart").Bone["Bone.001"]["Bone.002"]["Bone.003"]["Bone.004"]["Bone.005"]["Bone.009"]["Bone.006"]
local nb3 = plr.Character:WaitForChild("RootPart"):WaitForChild("Bone")["Bone.001"]["Bone.002"]["Bone.003"]["Bone.004"]["Bone.005"]["Bone.009"]["Bone.006"]["Bone.008"]["Bone.007"]
if nb then
print("funny")
nb.CFrame = nb
end
if nb2 then
nb2.Transform = nb2
end
if nb3 then
nb3.CFrame = nb3
end
end)]]

while wait(0.5) do
event:FireServer({nb, nb.CFrame, nb2, nb2.CFrame, nb3, nb3.CFrame})
end

--[[

-sin(camDirection.x)

sin(camDirection.y)

]]

pseudo trout
tawdry saddle
#

fr

hollow widget
#

I'm still beginner

glacial tiger
#

when you say provided by someone you mean by the assistant right

pseudo trout
hollow widget
haughty cradle
#

if u just wanna vibe code u can just resign your life to me

pseudo trout
#

okay by an actual person okay thats only half way fixed

hollow widget
glacial tiger
#

script is quite complicated but

#

do ur rigs have the necessary bones

hollow widget
#

I'm sure of it, he said that he used this for the models and they worked. He's the same guy who sold the models to me and he said they worked for him.

glacial tiger
#

ah okay

#

put the script into a local script

#

starterplayerscripts

#

do u have the required events

#

in replicated storage

hollow widget
glacial tiger
#

oh ok

#

put the code into a local script

#

and put the local script in starterplayerscripts

hollow widget
#

Got it

#

Uh

#

It ain't working

#

Should I stream in Private Call to show what I'm doing or...?

glacial tiger
#

or startercharacterscripts

glacial tiger
hollow widget
glacial tiger
#

put it in startercharacterscripts

hollow widget
#

I did

glacial tiger
#

also go to output

#

wait

#

The first error isn’t even in the script you sent so

hollow widget
#

So what?

#

What's up with the error?

glacial tiger
#

try it in starterplayerscripts

#

and show output

hollow widget
glacial tiger
#

whole thing

#

also check your rig in workspace when u run the game does a torso actually exist

hollow widget
glacial tiger
#

hmm ok charscripts nvm

#

And change torso to rootpart

hollow widget
#

Its already set

worldly mangoBOT
#

studio** You are now Level 4! **studio