Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

PlayerGui is not a valid member of Player?

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

0

In that case it would be 9&10

0

One clients localscript cannot access the contents of another clients playergui's descendants

0

How would i do this then?

1 answer

Are you missing a . next to Players[target] or is it just me

1 comment

0

getting minuses all over the place lol

This discussion is preserved as it was. New answers, comments, and votes are closed.