#Head Turning Not Functioning
1 messages · Page 1 of 1 (latest)
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)
]]
I think your first mistake was asking the assistant
fr
Yeah I'm not really much of a good dev
I'm still beginner
when you say provided by someone you mean by the assistant right
Yeah the ai isnt gonna help you man, i learned by reading a LOT of forum post
Oh, no, this script was provided by an actual person. I just thought of not sending the one made by the assistant
OH
if u just wanna vibe code u can just resign your life to me
okay by an actual person okay thats only half way fixed
I just wanna know where to put this and how I can use it. I was told by the guy that I should get help from a scripter or smth
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.
ah okay
put the script into a local script
starterplayerscripts
do u have the required events
in replicated storage
oh ok
put the code into a local script
and put the local script in starterplayerscripts
Got it
Uh
It ain't working
Should I stream in Private Call to show what I'm doing or...?
or startercharacterscripts
check output
put it in startercharacterscripts
I did
whole thing
also check your rig in workspace when u run the game does a torso actually exist
Its already set
** You are now Level 4! **