Code issues - gui screen

What am i doing wrong? when i press the button nothing happen

local close = script.Parent.Parent.X

close.MouseButton1Click:Connect(function()

print("entrado")

game.StarterGui.ChooseMenu.Enabled = false

end)

You don’t change anything in StarterGui, you have to reference the local gui itself.

local close = script.Parent

close.MouseButton1Click:Connect(function()

print("entrado")

script.Parent.Parent.Parent.Parent.Parent.Enabled = false

end)

You want to change the PlayerGui, not StarterGui. When a player joins, everything in the StarterGui is Cloned to the PlayerGui.

local close = script.Parent.Parent.X
local player = game.Players.LocalPlayer

close.MouseButton1Click:Connect(function()

print("entrado")

player.PlayerGui.ChooseMenu.Enabled = false

end)
2 Likes

And how i do that? :sad: :open_mouth:

Oh I had no idea !! many thanks

No problem, everyone makes that mistake in the beginning!

Still no working! isn’t working help D:

local close = script.Parent.Parent.X
local player = game.Players.LocalPlayer

close.MouseButton1Click:Connect(function()

	print("print 1")
	player.PlayerGuiChooseMenu.Enabled = false
	print("print 2")

end)

Lol my bad, I had a typo. Try it again now.

player.PlayerGui.ChooseMenu.Enabled = false

There’s a typo. Add a period in that third line from the end between PlayerGui and ChooseMenu

1 Like

Now it works!! Thank you very much: D

1 Like