im using clickdetector inside brick, it has a normal script inside:
script.Parent.ClickDetector.MouseClick:Connect(function(p)
if p.Character.Masked.Value == true then
if p.Character.Bag.Value == false then
print("Stolen")
--give bag to character
p.Character.Bag.Value = true
script.Parent.Parent:Destroy()
elseif p.Character.Bag.Value == true then
p.PlayerGui.bagwarning.Enabled = true
wait(1)
p.PlayerGui.bagwarning.Enabled = false
end
end
end)
i also tried
script.Parent.ClickDetector.MouseClick:Connect(function(p)
if p.Character.Masked.Value == true then
if p.Character.Bag.Value == false then
print("Stolen")
--give bag to character
p.Character.Bag.Value = true
script.Parent.Parent:Destroy()
elseif p.Character.Bag.Value == true then
p.PlayerGui["bagwarning"].Enabled = true
wait(1)
p.PlayerGui["bagwarning"].Enabled = false
end
end
end)
and supposedly the (p) is the player that clicks it which is me, and i even CHECKED for that screen gui, the name IS correct, but it doesnt work and output says:
bagwarning is not a valid member of PlayerGui
please help :()

2 comments
simple, is bagwarning actually a valid member of PlayerGui? check it manually
THATS EXACTLY WHAT I SAID, I CHECKED AND ITS THERE!