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

Player is not a valid member of PlayerGUI?

Code:

script.Parent.MouseButton1Click:Connect(function()
	
	wait(3)
	-- local Player = script.Parent.Parent.Parent.Parent.Players
	-- local Bye1 = script.Parent.Parent.Parent.Parent.Players.LocalPlayer.BackPack["Early Type 100 Nambu"]
	-- local Bye2 = script.Parent.Parent.Parent.Parent.Players.LocalPlayer.BackPack["Early Type 14 Nambu"]
	local Texty = script.Parent.Parent.Parent.Frame.Text
	local MainFrame = script.Parent.Parent.Parent.MainFrame
	local Frame = script.Parent.Parent.Parent.Frame
	
	MainFrame.Visible = false
	Frame.TextLabel.Visible = false
	Texty.Visible = true
	Texty.Text = 'Loading'
	script.Parent.Parent.Parent.Parent.Players.LocalPlayer.BackPack["Early Type 14 Nambu"].destroy()
	script.Parent.Parent.Parent.Parent.Players.LocalPlayer.BackPack["Early Type 100 Nambu"].destroy()
	wait(1)
	Texty.Text = 'Loading.'
	wait(1)
	Texty.Text = 'Loading..'
	wait(1)
	Texty.Text = 'Loading...'
	wait(1)
	Texty.Text = 'Guns Created.'
	wait(3)
	Texty.Text = 'Beginning Your Battle.'
	wait(5)
	Texty.Text = 'Complete!'
	
end)

ERROR:   12:01:40.902 Players is not a valid member of PlayerGui "Players.UnknownUne.PlayerGui"  -  Client  -  LocalScript:15

I have a few theories as to why this is happening,

  1. It is because I have a custom character.
  2. It is because of how my Player settings are set up.

Solutions I have tried,

  1. WaitForChild,
  2. locals and non-locals,
  3. Another For Child that I completely forgot the name for.

5 comments

0

seems like you wanna access the local players backpack. Why not just type game.Players.LocalPlayers instead?

0

Well you see here. I just came back to making roblox games. So I will try that. I am relearning and it kinda sucks xD

0

Thanks noammao. That works fine. The rest I can find out on my own. I appreciate it, hopefully I will get back to the stage of coding I was at before.

0

I feel you man. I was in a spot just like you where I felt rusty and had to re-learn and get into the game again. If you've got your questions answered mark this as solved. Otherwise, I'll be happy to help

0

Im not sure how to make it solved xD. But I posted a new question if you can help. A little more confusing :/

1 answer

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