I am trying to pass an instance of an object from client to server and getting a problem with the instance being nil on the server.
I have added two screen shots below that show the studio for view of the two scripts involved and the output of the prints.
I am passing the instance so the server script can destroy the object.
Am I trying to do something thats impossible?
Passing an instance from client to server should only result in nil on the server if the object passed only exists on the client/parented to something that doesn’t replicate or if you’re using the wrong argument, which by looking at your code you’re not doing. So you’re probably sending a part that is client sided
If you pass an object that is added from the client(or a Localscript) then the server does not know about this part. If you want the server to register that, you should make a RemoteEvent so that the server can create the part for you. This way, the server is able to register that there’s a part.
Thanks guys. It was created in a local script so can sort myself out now.
Spoke too soon.
I had the client script change the parenting to Replicated Storage and confirm it was there.
The server script cant see it.
I can see it in explorer when playing locally.
I thought RS was shared between client and server.
Confirmed it is only seen on the client that set the objects parent.
Not on any other client or the server.
Will look into requesting a server script to create the object.