How do you know if the client has access to a workspace child?

I heard that you can define workspace children with LocalScripts only if the client has access to the child you’ll define … How do I know if the client has access to the child?

BasePart:GetNetworkOwner() —> player instance or nil

1 Like

???

Where should I write that code?

From the server, I dont think this method can be called from local scripts

If I wrote it, will the client have access to the instance I gave?

Yes, through RemoteEvents, or through a reference of the part on the client

Should it be something like this

BasePart:GetNetworkOwner(“Part”)

No, closer to something like this:

local myPart = workspace.MyPart
print(myPart:GetNetworkOwner()) —> prints out the player instance which is simulating the part

2 Likes

Alright, I’ll do that.

Should it be on the command bar? or in a simple Script?

Depends. The only instance I use this function is inside of a script if i’m checking for any randomly unanchored parts, which exploiters are able to set the position of.

1 Like

Alright. Thank you for answering all my questions!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.