'PlayerGui is not a valid member of Players.domboss37'

Hey guys I recently made a wordle clone on roblox for a video (releasing in 2 days) but I wanted to take it further and make a head to head mode, but thats besides the point, while making this I made a gui that has a list of the players in the game and when you click on one, the person that you clicked on gets a message for if they want to go to the head to head mode, however I keep getting an error (mentioned in the title). Anyways on how I can fix this?? Here is the click script in the GUI button:

script.Parent.MouseButton1Click:Connect(function()
	local playerName = script.Parent.Text
	local player = game.Players:FindFirstChild(playerName)
	if player then
		if player ~= game.Players.LocalPlayer and not player:WaitForChild("PlayerGui"):WaitForChild("Wordle"):FindFirstChild("Request") then
			local req = player.PlayerGui:WaitForChild("Wordle")["1v1Request"]:Clone()
			req.Name = "Request"
			req.Size = UDim2.new(0, 0, 0.156,0)
			req.Visible = true
			local tween = req:TweenSize(UDim2.new(0.202, 0, 0.156,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 1)
		end
	end
end)

try doing player:WaitForChild(“PlayerGui”)

I have tried it results in an infinite yield!

You can’t access another player’s player gui from a local script, use a remote event instead

So this is what I thought, so I made a remote function to return me the players player gui, would this still not work, would it still need to be edited on the server?

You should edit them on the server or the other player’s client

Alright I’ll try it out! (characters)

Thanks it works, but it gives me an error saying “Can only tween objects in the workspace” (on the line where I tween gui Size, or try too lol)

You didn’t set the parent of the gui after you cloned it

Ahh that is true but I also researched and found you cant tween someones player gui from the server.

Is that script inside a local script?

The client can handle tweening a lot better anyway, you shouldn’t be attempting to tween locally replicated instances (instances which only replicate to a single client) on the server.

1 Like