So I have this script, where you enter the name of a Player, then a reason, using TextBox's.
I will post what output says below:
script.Parent.MouseButton1Click:connect(function() plr=script.Parent.Parent.Parent.Parent.Parent.Parent theplayer = script.Parent.Parent.Name.Text HR=plr.Name reason = script.Parent.Parent.Reason.Text if game.Players:FindFirstChild(theplayer) ~= nil then print("foundplayer") theplayer.PlayerGui.Warning.Frame.Visible=true theplayer.PlayerGui.Warning.Frame.Part1.Text="You have been given a warning by "..HR..", if you continue to break the rules, you may be banned from the event" theplayer.PlayerGui.Warning.Frame.Part2.Text="Reason for the warning: "..reason elseif game.Players:FindFirstChild(theplayer)==nil then print("CouldntFindEm") end end)
18:06:26.265 - Argument 1 missing or nil
18:06:26.266 - Script 'Players.Player1.PlayerGui.HRWarn.Frame.Frame.TextButton.Scr', Line 6
18:06:26.267 - Stack End
18:06:26.267 - Disconnected event because of exception
Please upvote my rep and/or mark this as the correct answer is this worked or helped you.
The error is saying that the value of theplayer is nil, and this is probably nil because the path to it is incorrect. Perhaps too many .Parents, or too little?