Gui not closing

can you try deleting local from function :

function onClick()

ok will do now :smiley: :slight_smile:

now it just doesnt work at all lol

Line 14 was erroring because the first “Parent” was misspelled as “Parnet”. It was the same when you were trying to print it.

Nice catch! I also copied it from @ineed_massnow 's script.

so urm what should i do now? :thinking:

Change Parnet to Parent :stuck_out_tongue:

oke done that should that work now?

it needs to work if it doesn’t works idk anything more :stuck_out_tongue:

ohhhhhhhhhhhhhhhhhhh it removed the thing but to fast

just add wait() to fix this …

now it doesn’t work welp :frowning_face:

local function onClick()
	local players = game:GetService("Players")
	local player = players.LocalPlayer

	for i = 1, 0, -0.1 do

		script.Parent.Parent.Parent.Music.Volume = i
		wait(0.07)
	end
	script.Parent.Parent.Parent.Music:Stop()
	player.Character.Humanoid.Health = 0
    wait(5)
    script.Parent.Parent.Parent.Enabled = false
end

script.Parent.PlayButton.MouseButton1Click:Connect(onClick)

here

YESSSSSSSSSSSSSSSSS thank you :smiley:

No problem i just confused when it doesn’t work :stuck_out_tongue: I am gonna check my scripts spelling next time :smiley:

thats ok just 1 more thing the menu icon disappears when the 5 seconds is over

it is because you are closing all the guis in the MenuGui you can try closing frame guis with visible like :

script.Parent.Parent.Parent.MainMenu.Visible = false

if it is closing icon too this means menu icon is in frame then you can try closing other guis with visible instead of icon

ah right because oh there is a frame for main menu

image here any way to close that one?

which one? is icon in the frame?