The simplest way to do this is to use a remote function as this will also work with fe. This will allow us to send the string names of what the processing finds. We cannot send the objects unless both sides have access to them e.g. parts in the workspace.
Example using remote functions:-
local remoteFunction = Instance.new('RemoteFunction', game:GetService('ReplicatedStorage'))
remoteFunction.Name = 'test'
function remoteFunction.OnServerInvoke(plr, getChildren, ...)
local args = {...}
if #args == 0 then return {'No args passed'} end
local tmpTabl = {}
local tmpData = game
for i=1, #args do
if tmpData:FindFirstChild(args[i]) then
tmpData = tmpData:FindFirstChild(args[i])
else
return {'Endpoint is nil'}
end
end
if getChildren then
for _, v in pairs(tmpData:GetChildren()) do
table.insert(tmpTabl, tostring(v))
end
else
table.insert(tmpTabl, tostring(tmpData))
end
return tmpTabl
end
Local script example:-
local remFunc = game:GetService('ReplicatedStorage'):WaitForChild('test')
print('from server', unpack(remFunc:InvokeServer(false, 'Workspace','Part')))
print('from server', unpack(remFunc:InvokeServer(true, 'Workspace','Part')))
print('from server', unpack(remFunc:InvokeServer(true, 'ServerStorage','Padasd')))
print('from server', unpack(remFunc:InvokeServer(true, 'ServerStorage','Part')))
This is just my test setup.
You can also send the logs to the client. This would also use the same method of a remote function to pass back the logs to the client.
I hope this demo shows how this can be used. You should be able to adapt and change this to provide the functionality you need.
Please comment if you do not understand how / why this code works.
3 comments
Use a block quote please. :)
No, use a CodeBlock.
Sorry, was tired, thats what I ment. :3