✓ Accepted answer
###This is because the 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.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local WelcomeEvent = ReplicatedStorage:WaitForChild("WelcomeEvent")
WelcomeEvent.OnClientEvent:Connect(function()
script.Parent.Enabled = true
end)
###Server script:
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)
###Read on common mistakes here.
1 comment
Thanks, it fixed it. You guys are very helpful here. :)