Player is not a valid member of frame?

my script is

local Player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.Ban:FireServer(script.Parent.Parent.Player.Text,script.Parent.Parent.Error)
end)

the error is

  12:55:10.851  Player is not a valid member of Frame "Players.Oozymage.PlayerGui.Staff_Panel.Pban_Menu"

Maybe the code is confusing your “Player” variable with a player?

in here you wrote:
game.ReplicatedStorage.Ban:FireServer(script.Parent.Parent.Player.Text,script.Parent.Parent.Error)

script.Parent.Parent.Player.Text
Don’t you mean Parent instead of Player?

If you have something named Player on your ScreenGui, rename it or rename the variable. I think it will work after that.

Maybe add another .Parent? It’s hard to tell what you’re referencing, if that doesn’t work, try print debugging or referencing them without using .parent.

no if do parent it goes off to the screengui

Can you show us what “Player” is in explorer?

How are you going to reference a player inside of a ScreenGUI?

im not, I’m saying if I do what u say it does that

Alright I got it! I forgot to rename something