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:
- Clicked is not a valid event of a part
- MouseButton1Click is not a valid event of part either (assuming this script is in a part based on variable names
- The function you connected to the non-existent event is not written correctly at all
- Player is not a variable nor is it anything you can refer to without creating a variable (line 6)
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)
1 | local Part = script.Parent |
2 | local Player = 'Player Name Here' |
3 | local clickDetector = Instance.new( 'ClickDetector' ) |
4 | clickDetector.Parent = Part |
6 | clickDetector.MouseClick:connect( function () |
7 | game.Players [ Player ] .ScreenGui.Frame.Visible = true |
hopefully this script is something near what you intended to do.