Gunlook / Look IK Replication Problems

I’ve been trying to do replication for IK since I need the direction players are looking at to be visible to all clients (To allow players to know how aware other players are) I also thought using IK would make it fairly lightweight, A previous attempt to use a Cframe setup didn’t work too well and caused visual issues with animations.

I’ve never ever done Replication before and my attempts aren’t working since I keep getting “did you forget to implement onserverevent?” Errors and the Documentation isn’t helping me very much either.

Here’s the code and some context as it stands right now Some parts are commented out because they just weren’t working at the moment

The RemoteEvent called “AimPass” is parented to the tool

LocalScript (Parented to a tool)

Tool = script.Parent
mouse = game.Players.LocalPlayer:GetMouse()
--local AimPass = script.Parent:WaitForChild("AimPass")

local character = Tool.Parent;
local humanoid = character.Humanoid

local targetPos = humanoid.TargetPoint
local lookAt = (mouse.Hit.p - character.Head.Position).unit

local invTarget ="Part")
invTarget.Parent = workspace
invTarget.Size =,0.05,0.05)
invTarget.Transparency = 1
invTarget.CanCollide = false
invTarget.Anchored = true

local LookAtIK ="IKControl")
LookAtIK.Type = Enum.IKControlType.LookAt
LookAtIK.EndEffector = character.Head
LookAtIK.Target = invTarget
LookAtIK.ChainRoot = character.LowerTorso
LookAtIK.SmoothTime = 0.1
LookAtIK.Parent = character.Humanoid
LookAtIK.Enabled =  true
LookAtIK.Weight = 0.5

	while mouse.Move do

		invTarget.Position = mouse.Hit.p
--		local aim1 = character.Head.CFrame
--		AimPass:FireServer(aim1)


Script (Parented to the same tool)

local AimEvent = script.Parent:WaitForChild("AimPass")

local hed = script.Parent.Parent.Humanoid.Head

local function sightBallsEyedBalls(aim1)
	hed.Cframe = aim1

AimEvent.OnServerEvent:Connect(sightBallsEyedBalls(pl, aim1))

Forgot to say I was looking for help on how Remote events even work and what the best way to approach this would be, I’m not exactly sure if me passing just the position and rotation of individual player’s body parts would be the best solution or passing IK and the aim position to the server instead would be the better way to do it or not
This also works (IK Bends the player) when it’s parented to a tool btw I forgot to mention that too oops