I’m having trouble reading my script, I can’t seem to figure out where to put the magnitude, everywhere I try it yields an error stating that I tried to perform arithmetic on userdata. This is my script: (The comment is the magnitude)
local Char = script.Parent local Humanoid = Char:WaitForChild("Humanoid") local Camera = workspace.CurrentCamera Char:WaitForChild("Head") local Neck = Char:FindFirstChild("Head"):WaitForChild("Neck") local Waist = Char:FindFirstChild("UpperTorso"):WaitForChild("Waist") game:GetService("RunService").RenderStepped:Connect(function() game.ReplicatedStorage.Head:FireServer(CFrame.new(0,.8,0) * CFrame.Angles(math.atan2(Camera.CFrame.lookVector.Y, math.sqrt((Camera.CFrame.lookVector.X^2)+(Camera.CFrame.lookVector.Z^2)))/1.5, math.pi * 2,0),CFrame.new(0,0,0) * CFrame.Angles(math.atan2(Camera.CFrame.lookVector.Y, math.sqrt((Camera.CFrame.lookVector.X^2)+(Camera.CFrame.lookVector.Z^2)))/3.5,math.pi * 2,0)) end) --(game.Workspace.CurrentCamera.CFrame.p-game.Players.LocalPlayer.Character.Head.Position).magnitude
- List item
(Serverscritp)> > > > > > > > local Remote = game.ReplicatedStorage.Head > > > > > > > > Remote.OnServerEvent:Connect(function(Player, c0,c01) > > > > > > > > if not Player.Character then return end > > > > > > > > if not Player.Character:FindFirstChild("Head") or not Player.Character.Head:FindFirstChild("Neck") then return end > > > > > > > > local b = TweenInfo.new(.5,Enum.EasingStyle.Quint) > > > > > > > > local a = { > > > > > > > > C0 = c0 > > > > > > > > } > > > > > > > > game:GetService("TweenService"):Create(Player.Character.Head.Neck,b,a):Play() > > > > > > > > local b = TweenInfo.new(.5,Enum.EasingStyle.Quint) > > > > > > > > local a = { > > > > > > > > C0 = c01 > > > > > > > > } > > > > > > > > game:GetService("TweenService"):Create(Player.Character.UpperTorso.Waist,b,a):Play() > > > > > > > > end)