Help with passing something from a function to the server

I need to get the kunaiClone so I can pass it to the server but I’m unsure how I would do so.

`local plr = game.Players.LocalPlayer
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local humRP = char:WaitForChild("HumanoidRootPart")

local RS = game:GetService("ReplicatedStorage")
local Debris = game:GetService("Debris")
local UIS = game:GetService("UserInputService")
local TS = game:GetService("TweenService")
local RunService = game:GetService("RunService")

local debounce = false
local CD = 1
local count = 0

local tpRemote = RS.Remotes.Teleport

local mouse = plr:GetMouse()

local KEY = Enum.KeyCode.V

local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {char}

local camera = workspace.CurrentCamera

local kunai = RS.FX.RaijinKunai

local function throwKunai()
	
	local rayMaxDist = 1500
	local mousePos = UIS:GetMouseLocation()
	local rayOrigin = camera:ViewportPointToRay(mousePos.X, mousePos.Y)

	local raycastResult = workspace:Raycast(rayOrigin.Origin, rayOrigin.Direction * rayMaxDist)
	

	if raycastResult == nil then print("nil")
		return
	end
	
	local kunaiPosition = humRP.Position
	
	local kunaiClone = kunai:Clone()
	kunaiClone.Parent = workspace.Map.Ignore
	kunaiClone.CanCollide = false
	kunaiClone.Anchored = true
	kunaiClone.CFrame = CFrame.lookAt(kunaiPosition, raycastResult.Position)  * CFrame.Angles(0, math.rad(-90), math.rad(90))
	
	local distance = (raycastResult.Position - kunaiPosition).Magnitude -- (Target Position - Object Position)
	local speed = 150
	
	local tweenTime = distance / speed
	
	local objHit = raycastResult.Instance
	
	local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
	local kunaiDirection =  {Position = raycastResult.Position}
	local tweenKunai = TS:Create(kunaiClone, tweenInfo, kunaiDirection)

	tweenKunai:Play()
	
	print(objHit)
	print("Pressed V")
	
end



UIS.InputBegan:Connect(function(inp, gpe)
	if gpe then return end
	if inp.KeyCode == KEY and not debounce or count >= 1 then
		debounce = true
		count += 1
		if count <= 1 then
			throwKunai()
		end
		if count >= 2 then
			tpRemote:FireServer(kunai.Position, kunai)
			count = 0
			print("reset count")
		end
		print(count)
		task.wait(CD)
		debounce = false
	end
end)

`

Hey, I’m not really sure what you want to do but it seems like you’re trying to create a local variable of “kunai” that clones it every time you use that variabel, if so you should handle the cloning in a server script, this is because any script inside the cloned part or affecting the cloned part won’t work if it isn’t cloned in a server script.