How to get another players playerGUI locally?

Alright, so basically what I want the script to do is get one’s playerGUI locally, then use a remote to clone the GUI onto a part, however I can’t seem to get the script to work.

local player = game.Players.LocalPlayer
local remote = game.ReplicatedStorage.GuiEvent
while true do
	for i,v in pairs(player.PlayerGui:GetChildren()) do
		if v.ClassName == "ScreenGui" then
			for i,s in pairs(v:GetChildren()) do
				if s.ClassName == "Frame" then
			    clonegui = s:Clone()
				clonegui.Parent = workspace.Part.SurfaceGui
					if clonegui:FindFirstChild("ChatChannelParentFrame") then
						clonegui.ChatChannelParentFrame.Frame_MessageLogDisplay.Scroller.CanvasPosition = game.Players.Rescripted_Developer.PlayerGui.Chat.Frame.ChatChannelParentFrame.Frame_MessageLogDisplay.Scroller.CanvasPosition
					end
					remote:FireServer()
					end
			end
		end
	end
	task.wait(0.1)
	workspace.Part.SurfaceGui:ClearAllChildren()
	end

then the code should send out a remote to clone the player gui to server script, but I cant understand why its not working.

Instances made on the client cannot be send to server as in theory: an exploiter could send any instance up to the server and have total control of it.

oh, basically theres no way to do this?

There is. You just got to serialize the data.

Here is a tutorial I recommend: How to save parts, and the idea of Serialization

Serialized data can be send up to server and then send to another client and de-serializesld.

1 Like

otherPlrObject.PlayerGui.GUINAME

Like I mentioned; a client cannot access another client’s PlayerGui.

1 Like