here is my script
game.Players.PlayerAdded:Connect(function(plr) script.Parent.MouseClick:Connect(function() plr.PlayerGui.Colorgui.Frame.Visible = true end) end)
there is an error in the output and it is this 11:21:17.225 - Colorgui is not a valid member of PlayerGui 11:21:17.225 - Stack Begin 11:21:17.225 - Script 'Workspace.Part.ClickDetector.Script', Line 4 11:21:17.226 - Stack End Now before you say that well it's because you don't have an colorgui in the playergui i do but it isn't doing what i would like it to
help please.
So there are a few issues that arise from the way you are approaching this.
A player's GUI does not replicate with the server (and rightly so). There's no point in that information being sent to the server as unlike work geometry, physics, etc. Literally only the individual player is going to see their GUI.
The solution to this would be to either use a remote event (which i'd argue is overly complicated) or to use a local script.
local colorFrame = game.Players.LocalPlayer.PlayerGui:WaitForChild("Colorgui"):WaitForChild("Frame") game.Workspace.ExampleButton.ClickDetector.MouseClick:Connect(function(player) colorFrame.Visible = true end)
This is problematic as anytime anyone clicks the part then everyone's GUI will be affected.
If this is your intention then you should connect 1 event on the server and use a remote event and the FireAllClients
method to replicate the change to every player.