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)
local frame = script.Parent.Parent local reason = frame.Reason local plrName = frame.PlayerName --No debounce needed. script.Parent.MouseButton1Click:Connect(function() if game:GetService("Players"):FindFirstChild(plrName.Text) then -- do code else print"player not found!" end end)