This is my current code
local clickDetector = script.Parent.ClickDetector local function openMenu(player) game.StarterGui.WelcomeGui.Enabled = true end clickDetector.MouseClick:Connect(openMenu)
I am trying to make it so when that part is clicked, it will enable a ScreenGui that I have disabled in StarterGui. I have tried it but nothing shows in Dev Console so I don't know what's wrong.
WelcomeGui
is not in StarterGui
. It is in PlayerGui
. Seeing your script is a server script, the contents of PlayerGui
cannot be accessed by the server unless the server placed it there. However, you shouldn't be doing anything GUI related on the server. Instead, use a RemoteEvent
.-- LocalScript, under your WelcomeGui local ReplicatedStorage = game:GetService("ReplicatedStorage") local WelcomeEvent = ReplicatedStorage:WaitForChild("WelcomeEvent") WelcomeEvent.OnClientEvent:Connect(function() script.Parent.Enabled = true end)
local ReplicatedStorage = game:GetService("ReplicatedStorage") local WelcomeEvent = ReplicatedStorage:WaitForChild("WelcomeEvent") local clickDetector = script.Parent.ClickDetector local function openMenu(player) WelcomeEvent:FireClient(player) end clickDetector.MouseClick:Connect(openMenu)