Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can someone troubleshoot my GUI? *Unanswered, updated the script*

So here is the script

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
else
print("CouldntFindEm")

end

end)

Output no longer gives me any trouble, but it still will not find the player based on what the player puts in the textlabel. It prints "CouldntFindEm" no matter what.

1 answer

✓ Accepted answer

try

if FindFirstChild('') == nil then --sry, cant use my speech marks

and if its the opposite then

if FindFirstChild('') ~= nil

if u want to do stuff if its not nil

This discussion is preserved as it was. New answers, comments, and votes are closed.