Linking localscript to server script wont work with remote? attempt to index nil with 'Hit'

I’m trying to make it so wherever the user of a tool clicks a part is released and goes to the direction of the person’s mouse however it doesn’t work?

server code

local player = game.Players.LocalPlayer
local tool = script.Parent
local event = tool:WaitForChild('Event')
event.OnServerEvent:Connect(function(player, mouseEvent)
	print(player, mouseEvent)
	--create the star when we click the mouse button: 		
	local star ="Part")
	local starmesh = game.ReplicatedStorage.Starmesh:Clone()
	local dmg = game.ReplicatedStorage["Damage Script"]:Clone()

	star.Shape = Enum.PartType.Ball
	star.BrickColor ="Black")
	star.Anchored = false
	star.CanCollide = false
	star.Massless = true
	star.CFrame = player.Character.HumanoidRootPart.CFrame *,0,-1)
	star.CFrame =, mouse.Hit.p) --make the star face the mouse position
	star.Size =,2,2)
	dmg.Parent = star
	starmesh.Parent = star
	--gravity is a nono
	local antiGravity ="BodyForce")
	antiGravity.Force =, workspace.Gravity * star:GetMass(), 0)
	antiGravity.Parent = star

	--add star to workspace bSfore firing
	star.Parent = workspace
	star.Velocity =, mouse.Hit.p).lookVector * 100 -- change this number to a smaller number if you want the star to go slower
	mouse = mouseEvent

client code

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

local tool = script.Parent

local event = tool:WaitForChild('Event')


Help would be appreciated thank you

use mouse.hit.p (it is a Vector3)

What is mouse?
Did you mean mouseEvent?

Don’t forget:
Hit is a CFrame

Hit.p is a vector3

mouse.Target is an object or nil[ if it points at the sky or something alike]