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
01script.Parent.MouseButton1Click:connect(function()
02plr=script.Parent.Parent.Parent.Parent.Parent.Parent
03theplayer = script.Parent.Parent.Name.Text
04HR=plr.Name
05reason = script.Parent.Parent.Reason.Text
06if game.Players:FindFirstChild('theplayer') ~= nil then
07 
08print("foundplayer")
09theplayer.PlayerGui.Warning.Frame.Visible=true
10theplayer.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"
11theplayer.PlayerGui.Warning.Frame.Part2.Text="Reason for the warning: "..reason
12else
13print("CouldntFindEm")
14 
15end
16 
17end)

3 answers

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

Line 6

1if 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
01script.Parent.MouseButton1Click:connect(function()
02plr=script.Parent.Parent.Parent.Parent.Parent.Parent
03theplayer = script.Parent.Parent.Name
04HR=plr.Name
05reason = script.Parent.Parent.Reason.Text
06if game.Players:findFirstChild(theplayer) ~= nil then -- findFirstChild is not FindFirstChild.
07 
08print("foundplayer")
09theplayer.PlayerGui.Warning.Frame.Visible=true
10theplayer.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
11theplayer.PlayerGui.Warning.Frame.Part2.Text="Reason for the warning: "..reason
12else
13print("Something")
14 
15end
16 
17end)

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
1theplayer = 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