My script was made in 5 minutes, it's really short and it's kind of rushed. I don't know if there are any mistakes. I need help fixing this, thank you.
local Part = script.Parent Part.Clicked:connect(function(onClicked) local C = script.Parent.MouseButton1Click:connect(function() if C then Player.PlayerGui.ScreenGui.Frame.Visible = true end end
Assuming you have a ClickDetector in the part that the variable "Part" equals, .Clicked is not an event of part neither is it an event of a ClickDetector. But I'm going to assume you don't have a click detector at all so here is what you did wrong:
enough of listing your faults, here is the fixed version of what you posted assuming there is not a click detector inside of the variable Part and Part is actually a basepart (idk if this is even what you intended to do as the script you wrote has no information)
local Part = script.Parent local Player = 'Player Name Here' --Case Sensitive local clickDetector = Instance.new('ClickDetector') clickDetector.Parent = Part clickDetector.MouseClick:connect(function() game.Players[Player].ScreenGui.Frame.Visible = true end)
hopefully this script is something near what you intended to do.