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)
✓ ANSWER ACCEPTED
Can someone tell me what is wrong with this?
3 answers
✓ Accepted answer
Line 6
if game.Players:FindFirstChild('theplayer') ~= nil then
you are looking for something named "theplayer" take out the 's and it will find something named what the variable theplayer is
script.Parent.MouseButton1Click:connect(function()
plr=script.Parent.Parent.Parent.Parent.Parent.Parent
theplayer = script.Parent.Parent.Name
HR=plr.Name
reason = script.Parent.Parent.Reason.Text
if game.Players:findFirstChild(theplayer) ~= nil then -- findFirstChild is not FindFirstChild.
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." -- Decided to add a period for good grammar
theplayer.PlayerGui.Warning.Frame.Part2.Text="Reason for the warning: "..reason
else
print("Something")
end
end)
That should be about it from what I could see this might not work though.
theplayer = script.Parent.Parent.Name
Please post any scripts relevant to it because that's the most I could decipher just from that.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Tochi log on roblox
k