Attempt to find index nil with play

I want to tween the part to the player

Server script


local rS = (ReplicatedStorage)
rs.pickUp.OnServerEvent:Connect(function(p,item
local finalPosition = p.HumanoidRootPart.CFrame
local tween = game:GetService(“TweenService”):Create(item,(my tween info),{CFrame = finalPosition})
—But that’s not the problem, this is
tween:Play()



Output is the topic title
I don’t think it’s because of the local script that fires the event

The entire script is unclear. What are the arguments that you passed through the parameter from the client?

Ok, I will post the details of those scripts when i come home

I need more details to find the error (tween info and passing arguments)

Also might have been a typo but it should be

rs.pickUp.OnServerEvent:Connect(function(p,item)
--Code
end)

--not

rs.pickUp.OnServerEvent:Connect(function(p,item
--Code

This should work

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")

local tweenInfo = TweenInfo.new(10)  -- your tweenInfo
ReplicatedStorage.pickUp.OnServerEvent:Connect(function(player, item)
	local finalPosition = player.Character.HumanoidRootPart.CFrame
	local tween = TweenService:Create(item, tweenInfo, {CFrame = finalPosition})
	tween:Play()
end)

I managed to fix it myself so thanks for help