So let's say I have a textlabel in Player 1 StarterGui and I want to clone it and put it specifically in Player 2's StarterGui, how would I go about scripting and accessing Player 2's StarterGui or am I trying to script this the wrong way?
How would I access another player's StarterGui?
1 answer
So how you would do this is simple, though you'd have to use client-server-client communication.
First, create a RemoteFunction in ReplicatedStorage.

Then, you want to make a Script in ServerScriptService.

From there you'll go into the script and type the following:
local repStorage = game:GetService("ReplicatedStorage")
local remoteFunction = repStorage.RemoteFunction
remoteFunction.OnServerInvoke = function(player1, player2, gui)
gui:Clone().Parent = player2.PlayerGui
end
Then, you'll make a LocalScript inside of the ScreenGui you're trying to clone.

Inside of the LocalScript, you will put this.
local repStorage = game:GetService("ReplicatedStorage")
local remoteFunction = repStorage.RemoteFunctionprint("Hello world!")
local guiObject = script.Parent
remoteFunction:InvokeServer("PlayerNameHere", guiObject)
This should work fine. The InvokeServer function takes a Player's name as an argument, and the gui you're trying to clone.
If you need any more help, let me know.
3 comments
This is how to clone something into another player's PlayerGui, you can access their PlayerGui with basically the same process.
Thanks for the response:)
No problem! If you need any more help you can DM me on discord at Galaxy#0420
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
There is unfortunately no peer-to-peer communication, so you'd be forced to use remote events/functions to transfer from the donor to the server and from the server to the recipient.
Thanks for the response:)