Remote function returns nil

i made a remote function which is supposed to clone an instance and return it - so i can clone instances from a local script, but it returns nil?

local remote = game.ReplicatedStorage.Remotes.CloneInstance

remote.OnServerInvoke = function(plr,instance)
	local clone = instance:Clone()
	
	return clone
end

Is the instance created on the server or client?

when the instance is sent through the remote to the client, the server is actually sending a reference to it so the client can use that reference and set the clientside version of it onto a variable

but in this case, since you didn’t parent the instance, it hasn’t replicated and there isn’t a clientside version

oh, ill try to parent it and reply if it worked.

you might need to wait something like a Step to give it time to replicate too

1 Like

ill try that, parenting didnt work

it is created on the server side