Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 10 years ago

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

Log in to vote
0
Answered by
KAAK82 16
10 years ago

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

Ad

Answer this question