Is there any way to send an instance using a remote function to the server, clone it, and send it back to the client as a variable?

when I try it returns "Part is not a valid DataModel of “Place @ [date&time]”
these are the client and server scripts if you need them
client:

local part = game.ReplicatedStorage.RemoteFunction:InvokeServer(game.ReplicatedStorage:WaitForChild("Part"))
local segments = string.split(part,".")
local current=game
for i,v in pairs(segments) do
	current=current[v]
end
part = typeof(current)

server:

game.ReplicatedStorage.RemoteFunction.OnServerInvoke = function(player, part)
	local part = part:Clone()
	local partstr = throw:GetFullName()
	part.Parent = workspace
	return partstr
end
1 Like

You can place the part into a model and return the model. I’m not sure why, but I didn’t notice that parts cant be send. I’m sending lots of models and I guess accessories as variables from server to client and I have no issues at all, never noticed that parts alone are been get on client as nil.

Ah… wait, I didnt pay attention to your script until now. But, you mean, create a part on client side and send it to server?
I dont think thats possible, if a client creates something on their side, it wont replicate on the server, for server that part doesnt exist


Another edit… Im getting confused with your plan. You only want to tell the server to clone and do something with a part that exist inside ReplicatedStorage? not literally send a new part owned by the client right?
I dont see the issue with that then

You could do it, but your scripts have many errors here. The first one that you noticed is caused directly by finding the full name before setting the part’s parent.