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

Can someone tell me what is wrong with this?

Asked by 10 years ago
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)

3 answers

Log in to vote
0
Answered by
Versimn 20
10 years ago

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

Ad
Log in to vote
0
Answered by
IcyEvil 260 Moderation Voter
10 years ago
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.

Log in to vote
-1
Answered by 10 years ago
theplayer = script.Parent.Parent.Name

Please post any scripts relevant to it because that's the most I could decipher just from that.

0
Tochi log on roblox HexC3D 830 — 10y
0
k TochiWasHere 10 — 10y

Answer this question