so i'm trying to make a custom admin panel and for a part of the script i'm doing is a warning script, you enter a players name and it warns the player. if you enter a player name and that player does not "exist" then it would display nothing. but if you enter a wrong player name then a error comes up and if you enter the right name it wont work :/ here is the script:
local PlayerName = script.Parent.Parent:WaitForChild("PlayerNameV") -- this is for what i'm writing later
local Reason = script.Parent.Parent:WaitForChild("ReasonV") -- same as above
local Frame = script.Parent.Parent
local debounce = true
script.Parent.MouseButton1Click:Connect(function()
if debounce == true then
debounce = false
if game.Players[Frame.PlayerName.Text] then
print(Frame.PlayerName.Text)
end
wait(.2)
debounce = true
end
end)

4 comments
You say you want 2 different things for: if you enter a name of a player that does not exist and if you enter an incorrect name, but both of these are the same. Please clarify.
Also you haven't said what is wrong with your code.
well what happens is when you enter something into a text box, then press a button, it checks if the text you entered in the text box is equal to a name in game.Players. if it is then it will print the players name. if there is no player that is equal to the text you put in the text box, then nothing will happen. The problem is that when you enter something into the text box and it does not equal
a name in game.Players, a error pops up in the output and if you then try to enter a name that is correct, it wont work