Is something wrong with hierarchy

so im making a custom admin panel thing and i keep getting this error:

  Namebox is not a valid member of Frame "Players.woloexe.PlayerGui.GameUI.AdminButton.AdminPanel"  -  Client  -  LocalScript:23
  Stack Begin  -  Studio
  Script 'Players.woloexe.PlayerGui.GameUI.AdminButton.LocalScript', Line 23  -  Studio  -  LocalScript:23
  Stack End  -  Studio

and below is my code that is causing the errors:

---------------------------------------------------[ some variables ]

local localplayer = game.Players.LocalPlayer
local button = script.Parent
local panel = button.AdminPanel

---------------------------------------------------[ open/close logic ]

if localplayer.Name == "woloexe" then
	button.Visible = true
else
	button.Visible = false
	panel.Visible = false
end

function onButtonPressed()
	panel.Visible = not panel.Visible
end
button.MouseButton1Click:Connect(onButtonPressed)

---------------------------------------------------[ even more variables ]

local playervalue = panel.Namebox.Text
local player = game.Players.playervalue

local add = panel.Cash.AddCash.Text
local deduct = panel.Cash.DeductCash.Text
local set = panel.Cash.SetCash.Text

local addc = panel.Cash.AddCash.Confirm
local deductc = panel.Cash.DeductCash.Confirm
local setc = panel.Cash.SetCash.Confirm

local kick = panel.Moderation.Kick
local ban = panel.Moderation.Ban

----------------------------------------------------[ admin logic ]

addc.MouseButton1Click:Connect(function()
	player.leaderstats.Cash.Value += add
end)

It seems that you have not defined Namebox in local playervalue = panel.Namebox.Text. Could that be the issue? The game cannot find Namebox inside of the AdminPanel.

Could I see a picture of the explorer where the “AdminPanel” Instance is?

I think the POSSIBLE issue could be that it may not be able to find the name box because it didn’t exist at the time, when defining the Namebox or anything in this script at that, I recommend you utilize the:

Object:WaitForChild("blahblah")

Now if that doesn’t work, then I’m not quite sure what could be going on. If it did work, then put this as solved :sweat_smile: