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

Can someone tell me what is wrong with this?

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

✓ 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.

2 comments

0

Tochi log on roblox

0

k

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