So a text label that when you click on a text button it puts that player in the text label and when you press another text button it will make a GUI appear on their screen. But I get the error PlayerGui is not a valid member of Player? It says the problem is Line 9 & 10.
function click()
local gameid = script.Parent.Parent.ID
local target = script.Parent.Parent.player.Text
local player = game.Players.LocalPlayer
if game.Players:FindFirstChild(target) then
if game.Players[target].PlayerGui.whole.Everything.Notification.Visible == true then
script.Parent.Parent.Error.Text = "Player Has Already Recieved Notification"
script.Parent.Parent.Error.Visible = true
wait(5)
script.Parent.Parent.Error.Visible = false
script.Parent.Parent.Error.Text = ""
end
elseif script.Parent.Parent.player.Text == "Click On Player To Share With" then
script.Parent.Parent.Error.Text = "Please Choose A Player"
script.Parent.Parent.Error.Visible = true
wait(5)
script.Parent.Parent.Error.Visible = false
script.Parent.Parent.Error.Text = ""
elseif game.Players:FindFirstChild(target).PlayerGui.whole.Everything.Notification.Visible == false then
if game.Players:FindFirstChild(target) then
local edit = game.Players[target].PlayerGui.whole.Everything.Notification
edit.from.Text = "Would you like to join a request from" .. player.Name
edit.id.Text = gameid
edit.Visible = true
else script.Parent.Parent.Error.Visible = true
script.Parent.Parent.Error.Text = "Player Is No Longer In Server"
wait(5)
script.Parent.Parent.Error.Visible = false
script.Parent.Parent.Error.Text = ""
end
end
end
script.Parent.MouseButton1Click:Connect(click)

4 comments
https://gyazo.com/0018aa242c7277def94df9bded2d939a
In that case it would be 9&10
One clients localscript cannot access the contents of another clients playergui's descendants
How would i do this then?