Ive tried this script but it doesn't seem to work:
1 | script.Parent.MouseButton 1 Down:Connect( function () |
2 | game.StarterGui.PurchaseGUI.Frame = true |
3 | end |
Make sure this is in a local script in StarterGui, and that you replace the variable.
1 | local part = game.Workspace.Part -- Your part here |
2 | local playerGui = game.Players.LocalPlayer:WaitForChild( "PlayerGui" ) |
3 |
4 | part.ClickDetector.MouseClick:Connect( function () |
5 | playerGui.PurchaseGUI.Enabled = true |
6 | end ) |
The PlayerGui is what the players see, so you need to put that there to enable it for a certain player.
ClickDetector use MouseClick Event, and you could use the parameter:
1 | script.Parent.ClickDetector.MouseClick:Connect( function (PlayerWhoClickedNotCharacter) |
2 | PlayerWhoClickedNotCharacter.PlayerGui.PurchaseGUI.Enabled = true |
3 | end ) |
Also i don't understand what u mean by .PurchaseGUI.Frame, so i changed it to .PurchaseGUI.Enabled