Does this instance belong to the server or player?

Started using Knit and was wondering whether the part created in ‘TestFunction’ is owned by the server or client when fired from the client.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Knit = require(ReplicatedStorage.Packages.Knit)

local TestService = Knit.CreateService {
	Name = "TestService",
	Client = {}
}

function TestService.Client:CreatePart()
	local part = Instance.new("Part")
	part.Parent = workspace
end

function.TestService:KnitInit()
	
end

function.TestService:KnitStart()
	
end

return TestService

If it’s fired from the client, but created on the server, then the server owns it.

So does that mean that this function isn’t passed to the client? Do you have any idea on how the networking works under the hood?

This will be owned by the server.
The client table is basically a list of client-accessible functions. They are still fired on the server.

Yes, funnily enough. I’ve done a deep dive into how it handles networking. Essentially, for each “Service”, it creates a folder in ReplicatedStorage, creating the necessary RemoteEvents/Functions. Then, when the client requires a Service, it pretty much “rebuilds” the object, using the Remotes it finds in the folder for that Service.
You also can’t send a function over Remotes or Bindables.

1 Like

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