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)