✓ Accepted answer
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)
local Part = script.Parent
local Player = 'Player Name Here'
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.
1 comment
It was nearly what I was looking for, but it helped. Thanks!