I am nearly there but ugh(i got the tick()bit from another tutorial)
Server
if script.Parent == workspace then script.Parent = game.StarterPlayer.StarterCharacterScripts; print("Please put the 'HeadMovementServer' script into StarterPlayer.StarterCharacterScripts."); end; if script.Parent == game.StarterPlayer.StarterCharacterScripts then return end; local tweenService = game:GetService("TweenService"); local remote = script:FindFirstChild("Remote") ~= nil and script.Remote or Instance.new("RemoteEvent", script); remote.Name = "Remote"; local debounce = tick(); remote.OnServerEvent:connect(function(player, mouseDirection, neck) if game.Players.LocalPlayer ~= nil then return end; if tick()-debounce <= 0.1 then return end; debounce = tick(); tweenService:Create(neck, TweenInfo.new(0.099), {C1=(CFrame.new(Vector3.new(-0, -0.500000119, -0.000272244215)) * CFrame.Angles(mouseDirection, 0, 0))}):Play(); end)
Local
if script.Parent == workspace then script.Parent = game.StarterPlayer.StarterCharacterScripts; print("Please put the 'HeadMovementServer' script into StarterPlayer.StarterCharacterScripts."); end; if script.Parent == game.StarterPlayer.StarterCharacterScripts then return end; local tweenService = game:GetService("TweenService"); local remote = script:FindFirstChild("Remote") ~= nil and script.Remote or Instance.new("RemoteEvent", script); remote.Name = "Remote"; local debounce = tick(); remote.OnServerEvent:connect(function(player, mouseDirection, neck) if game.Players.LocalPlayer ~= nil then return end; if tick()-debounce <= 0.1 then return end; debounce = tick(); tweenService:Create(neck, TweenInfo.new(0.099), {C1=(CFrame.new(Vector3.new(-0, -0.500000119, -0.000272244215)) * CFrame.Angles(mouseDirection, 0, 0))}):Play(); end)
I changed it here but i cant implement it to move the head in server
if script.Parent == workspace then script.Parent = game.StarterPlayer.StarterCharacterScripts; print("Please put the 'HeadMovementServer' script into StarterPlayer.StarterCharacterScripts."); end; if script.Parent == game.StarterPlayer.StarterCharacterScripts then return end; local tweenService = game:GetService("TweenService"); local remote = script:FindFirstChild("Remote") ~= nil and script.Remote or Instance.new("RemoteEvent", script); remote.Name = "Remote"; local debounce = tick(); remote.OnServerEvent:connect(function(player, HdPos, Neck)--HdPos--mouseDirection warn(player.name) warn(HdPos) if (player) ~= nil then return end; end)